repeating a script every two minutes
1 回表示 (過去 30 日間)
古いコメントを表示
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);
Someone posted the above code and it works fine when I replace disp with another function. How can I run a script instead of a function every 2 minutes?
0 件のコメント
回答 (1 件)
Image Analyst
2015 年 2 月 14 日
I know it seems kind of obvious, but what happened when you just put the name of your script instead of "disp('hi')"? Did that not work?
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!