If x>5 for y seconds, then z
2 次查看(过去 30 天)
显示 更早的评论
How can I write this in Matlab? Thanks.
If x>5 for y seconds, then z
2 个评论
Image Analyst
2022-11-22
You can invest 2 hours here and learn the basics:
If you have any more questions, then attach your data and code to read it in with the paperclip icon after you read this:
回答(1 个)
Image Analyst
2022-11-22
What's wrong with tic and toc?
startTime = tic;
elapsedTime = toc(startTime);
loopCounter = 1;
while elaspedTime < 5
fprintf('Iteration %d.\n', loopCounter)
pause(0.4); % Waste some time.
elapsedTime = toc(startTime);
end
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Naming Conventions 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!