답변 (2개)

Walter Roberson
Walter Roberson 2015년 7월 4일

0 개 추천

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.
Image Analyst
Image Analyst 2015년 7월 4일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2015년 7월 4일

답변:

2015년 7월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by