How to stop a program after a given time input?

4 ビュー (過去 30 日間)
Emmy
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?

サインインしてコメントする。

回答 (1 件)

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by