How to make a function/script start over

Hello,
How can I make a script/function start over (as if nothing had happened) if certain criteria are not met ?
Thank you, have a nice day !

 채택된 답변

Walter Roberson
Walter Roberson 2012년 5월 9일

0 개 추천

You cannot do that in MATLAB. You can, however, code a "while" loop that your code breaks out of if it is satisfied that everything is okay.

댓글 수: 3

laurie
laurie 2012년 5월 9일
oh nooo that's disappointing ^^ thank you :)
laurie
laurie 2012년 5월 9일
sorry i just did that and now my function is dreadfully slow ? is this to be expected ?
laurie
laurie 2012년 5월 9일
sorry it was a stupid mistake ^^

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

추가 답변 (1개)

Daniel Shub
Daniel Shub 2012년 5월 9일

0 개 추천

Assuming you have a logical vector x of whether or not your criteria were meet
if ~all(x)
!matlab -r myscript.m &
exit
end

카테고리

도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by