フィルターのクリア

Constructing for loop in terms of seconds

28 ビュー (過去 30 日間)
Yigit
Yigit 2011 年 11 月 20 日
コメント済み: vcmorini 2017 年 4 月 22 日
Hi,
for(10 seconds){
do this }
I would like to construct the following but I couldn't figure out how to input loop parameter in terms of time.
Thanks

採用された回答

Jan
Jan 2011 年 11 月 20 日
It does not work with a FOR loop, but with WHILE:
t0 = clock;
while etime(clock, t0) < 10
pause(0.05); % Some dummy lines
disp(clock);
end
  1 件のコメント
vcmorini
vcmorini 2017 年 4 月 22 日
Very nice answer! Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by