How To make matlab rerun the program?

조회 수: 66 (최근 30일)
ksjdn sdfs
ksjdn sdfs 2019년 2월 4일
답변: Venkat Krisshna 2021년 4월 8일
i want to make matlab rerun a code for me automatically, after the conditions are not met!
  댓글 수: 1
Adam Danz
Adam Danz 2019년 2월 4일
What's preventing you from writing a conditional that calls the function again?
Are you saying that the conditional is within the function you'd like to re-run? That could lead to recursion or an infinite loop which is a sign of poor coding. Maybe with some more info you could get better advice.

댓글을 달려면 로그인하십시오.

답변 (2개)

Kevin Phung
Kevin Phung 2019년 2월 4일
Use a while loop to keep re-running your function or script while some condition is true (in this case, 'not met'):

Venkat Krisshna
Venkat Krisshna 2021년 4월 8일
Use a while loop or an infinite while loop where you manually terminate the program.
tt=10;
iter=0;
while(tt>0)
iter=iter+1
pause(1)
<your program>
end

카테고리

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