Tic and Toc question
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone, I just have a quick question. How would I numerate my tic and toc so that I can make my program stop after a certain amount of time? I'm trying to say like, while tic<1 (second), continue, but I am most likely doing it wrong. Can anyone help?
0 件のコメント
採用された回答
その他の回答 (1 件)
Paulo Silva
2011 年 8 月 10 日
tStart = tic;
for n=1:2000
n
if toc(tStart)>=0.1 %100 miliseconds
disp('time exceeded')
break %if it's a function use return
end
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!