goto command in matlab
Show older comments
i have code consist from 80 step, at step 60 i have condition, if not true, it should be jump to step 30, my question, is there (goto) or somthing same command in matlab
Accepted Answer
More Answers (1)
Walter Roberson
on 22 Oct 2015
0 votes
Goto is not available in basic MATLAB but is available in a File Exchange Contribution for the amusement of those who know not to use GOTO, and for the frustration of those who insist they need GOTO.
1 Comment
Guillaume
on 22 Oct 2015
'amusement' is a key word here. That FEX contribution should not be used for anything else. I don't think the warning is strong enough on the FEX page and we may end up having some people trying to use it without understanding the implication.
That goto is basically an interpreter built on top of matlab own interpreter. As soon as you hit a goto, you're simply eval'ing the rest of the program line by line!
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!