skiping code after line 20
3 ビュー (過去 30 日間)
古いコメントを表示
Skip the coding after line 20 in script window
0 件のコメント
回答 (2 件)
Walter Roberson
2015 年 7 月 4 日
MATLAB has no "goto". If you are inside a function you can skip the rest of the function by using "return". If you are inside a "for" or "while" loop, you can use "break" to leave the loop.
0 件のコメント
Image Analyst
2015 年 7 月 4 日
You can put in this line for line 20 to skip running lines after line #20:
return; % Exit the script
You will get an orange squiggle under line 21 saying that "This statement (and possibly the following ones) cannot be reached." though you already know that so you can ignore the warning - your code will still run through line 20.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Get Started with MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!