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.

 採用された回答

Sean de Wolski
Sean de Wolski 2013 年 11 月 18 日

0 投票

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 件のコメント

Cagdas
Cagdas 2013 年 11 月 18 日
thanks a lot it works. however is there any way i can display these dots horizontally?
Sean de Wolski
Sean de Wolski 2013 年 11 月 18 日
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 2013 年 11 月 18 日
thank you so much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDates and Time についてさらに検索

質問済み:

2013 年 11 月 18 日

コメント済み:

2013 年 11 月 18 日

Community Treasure Hunt

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

Start Hunting!

Translated by