stop for loop if a thing happens
조회 수: 1 (최근 30일)
이전 댓글 표시
for example:
for i=1:10
a=i+1
if a>5
exit from loop % *which command do this*
end
end
댓글 수: 0
채택된 답변
Jan
2011년 9월 8일
Or BREAK.
You can find a list of commands concerning FOR loops in the "See also" line of help for. This line is created exactly for such questions.
댓글 수: 0
추가 답변 (2개)
참고 항목
카테고리
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!