Using timer, How can I cleanly exit a function execution, when the timer fires in MATLAB?
显示 更早的评论
My problem is that I can't find a Function to callback as a 'TimerFcn', that cleanly exits my function without errors.
t = timer('StartDelay',2,'TimerFcn', );
Thanks in advance.
2 个评论
Guillaume
2019-12-13
Can you explain more clearly what you're trying to do exactly, particularly, the order of execution of the various things you want to happen.
taima zoabi
2019-12-13
采纳的回答
更多回答(1 个)
Sean de Wolski
2019-12-13
Why use a timer for this?
In the start of your function, start a tic
t = tic
Then periodically check
if toc(t)>2
return
end
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!