Set timer to display sth in certain interval

Hello everyone,
I want my timer to display dots in every 0.01 second for one second.
Thanks.

 Akzeptierte Antwort

Sean de Wolski
Sean de Wolski am 18 Nov. 2013

0 Stimmen

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 Kommentare

Cagdas
Cagdas am 18 Nov. 2013
thanks a lot it works. however is there any way i can display these dots horizontally?
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);
Cagdas
Cagdas am 18 Nov. 2013
thank you so much.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Performance and Memory finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 18 Nov. 2013

Kommentiert:

am 18 Nov. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by