Return to a for loop in the middle of code?
1 回表示 (過去 30 日間)
古いコメントを表示
In the middle of my code, I have a little GUI that pops up asking for an input. Based on the number that is given, matrix manipulations are carried out. Once these lines of code are finished, I then want to return back to the same GUI, input a different number, which changes the matrices, and perform the same manipulations with this different data. How can I pop out of the program and return to a specific line in the middle of the program again?
Thanks!
0 件のコメント
採用された回答
Walter Roberson
2011 年 3 月 27 日
The mechanism to execute some code and return to the same place you left off is to call a function or execute a script. There is no way to jump to a specific line, no GOTO and not likely ever to be. There is a Matlab File Exchange contribution that simulates GOTO, but it is inadvisable.
0 件のコメント
その他の回答 (1 件)
Paulo Silva
2011 年 3 月 26 日
while 1
%your code
%if the user presses cancel or something on the GUI that asks for input
%break
end
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!