フィルターのクリア

Event-based script without any infinite loop

1 回表示 (過去 30 日間)
Alex Alex
Alex Alex 2021 年 7 月 31 日
コメント済み: Alex Alex 2021 年 8 月 26 日
Hello! is it possible to create an event and listeners based script (without GUI) that doesn't contain any infinite loops? If yes, how can I do this? Thank you.

採用された回答

Chunru
Chunru 2021 年 7 月 31 日
doc timer. Here is an example to display a message every 3sec for 3 times:
t = timer;
t.StartDelay = 3;
t.TimerFcn = @(myTimerObj, thisEvent)disp('3 seconds have elapsed');
t.Period = 2;
t.TasksToExecute = 3;
t.ExecutionMode = 'fixedRate';
start(t)
  1 件のコメント
Alex Alex
Alex Alex 2021 年 8 月 26 日
Thanks, this works fine

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by