How to stop a program after a given time input?

조회 수: 14(최근 30일)
Emmy 2013년 5월 11일
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?

댓글을 달려면 로그인하십시오.


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


Find more on Startup and Shutdown in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by