필터 지우기
필터 지우기

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)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by