How to write a "go to" -like statement in matlab
Ältere Kommentare anzeigen
Hi. Need a lil bit of help here. I normally work with fortran that supported a "go to" statement. Is there anyway that i could do the same ("go to" - like statement) using matlab? e.g.
if solution ==1
<do program statements A >
<do program statements B >
elseif solution ==2
<do program statements A (as previously stated above) only>
%this is where i normally used a go to previous line statement in fortran to avoid writing the same program statement twice.
end
Appreciate any help u can give
Akzeptierte Antwort
Weitere Antworten (1)
Ilham Hardy
am 12 Jun. 2012
3 Stimmen
Seems better to put statement A and B as seperate functions or scripts. Then you can call them whenever and wherever you want.
1 Kommentar
MHY
am 12 Jun. 2012
Kategorien
Mehr zu MATLAB Coder finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!