repeat a random function on matlab every 2 minutes

i have a function called. I want it to be repeated every two minutes. how can i do that with a timer?

 채택된 답변

Sean de Wolski
Sean de Wolski 2015년 1월 28일
T = timer('Period',120,... %period
'ExecutionMode','fixedRate',... %{singleShot,fixedRate,fixedSpacing,fixedDelay}
'BusyMode','drop',... %{drop, error, queue}
'TasksToExecute',inf,...
'StartDelay',0,...
'TimerFcn',@(src,evt)disp('hi'),...
'StartFcn',[],...
'StopFcn',[],...
'ErrorFcn',[]);
start(T);
replace disp('hi') with something useful.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

AA
2015년 1월 28일

댓글:

AA
2015년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by