Event-based script without any infinite loop
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Alex Alex
am 31 Jul. 2021
Kommentiert: Alex Alex
am 26 Aug. 2021
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.
0 Kommentare
Akzeptierte Antwort
Chunru
am 31 Jul. 2021
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)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!