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?

 Respuesta aceptada

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.

Más respuestas (0)

Categorías

Más información sobre Performance and Memory en Centro de ayuda y File Exchange.

Preguntada:

AA
el 28 de En. de 2015

Comentada:

AA
el 29 de En. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by