Introduce a fixed time delay

조회 수: 262 (최근 30일)
ANUBHAV SINHA
ANUBHAV SINHA 2012년 3월 28일
답변: Surama Biswas 2019년 5월 24일
Hi, I want a time delay of, say, 2minutes be introduced in between the execution of two statements. Can anyone suggest about how to achieve that....Any definite MATLAB functions available for that?
Ofcourse I have the idea of running an infinite loop for a calculated number of cycles to achieve that ...but I dont think that is an universal best way to do it and make the program 'computer-independent'.
Thanks.
Anubhav

채택된 답변

Image Analyst
Image Analyst 2012년 3월 28일
How about
pause(120.0);

추가 답변 (1개)

Surama Biswas
Surama Biswas 2019년 5월 24일
Also you can evaluate how much time required to execute your function f, by using timeit(f) and then use pause or simply using pause(timeit(f)).

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by