Run a loop every hour regardless of its calculation time!
12 次查看(过去 30 天)
显示 更早的评论
Hi All
I want to run a look evey hour and do some math inside the loop.
one solusion is to use tic/toc to get the math time and deduce it from the pause time, but I find it not efficient.
Any solusion to this?
Thanks.
1 个评论
采纳的回答
KALYAN ACHARJYA
2019-3-23
编辑:KALYAN ACHARJYA
2019-3-23
while true
tic
% some math here
elapsedTime=toc
pause(3600+elapsedTime);
clearvars elapsedTime;
end
% Please note on while loop to avoid infinite run
3 个评论
更多回答(1 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!