Set timer to display sth in certain interval

16 views (last 30 days)
Hello everyone,
I want my timer to display dots in every 0.01 second for one second.
Thanks.

Accepted Answer

Sean de Wolski
Sean de Wolski on 18 Nov 2013
T = timer('Period',0.01,... %period
'ExecutionMode','fixedRate',... %{singleShot,fixedRate,fixedSpacing,fixedDelay}
'BusyMode','drop',... %{drop, error, queue}
'TasksToExecute',100,...
'StartDelay',0,...
'TimerFcn',@(src,evt)disp('.'),...
'StartFcn',[],...
'StopFcn',[],...
'ErrorFcn',[]);
start(T);
  3 Comments
Sean de Wolski
Sean de Wolski on 18 Nov 2013
So:
T = timer('Period',0.01,... %period
'ExecutionMode','fixedRate',... %{singleShot,fixedRate,fixedSpacing,fixedDelay}
'BusyMode','drop',... %{drop, error, queue}
'TasksToExecute',100,...
'StartDelay',0,...
'TimerFcn',@(src,evt)fprintf(1,'.'),...
'StartFcn',@(src,evt)fprintf(1,'\n'),...
'StopFcn',@(src,evt)fprintf(1,'\n'),...
'ErrorFcn',[]);
start(T);

Sign in to comment.

More Answers (0)

Categories

Find more on Performance and Memory in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!