How to stop a program after a given time input?

1 次查看(过去 30 天)
I created a function in which one input is time in seconds. I want the program to stop after this time has passed. However, I am only aware of the tic toc and the cputime and I can't find out how to apply these in my situation. I hope you can help me.
  1 个评论
Daniel Shub
Daniel Shub 2013-5-14
It really depends on what your code is doing. How exactly do you want it to "stop". Do you want MATLAB to exit?

请先登录,再进行评论。

回答(1 个)

Ryan G
Ryan G 2013-5-13
Try the timer object using a single shot execution mode.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by