How to use break in for-if loop to get out of for loop?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
In following program, i am trying to 'use break to get out of for loop' after checking my condition in if loop. i am unsure that whether it is right.please help.
Thanks
for x= 1:n
if start(S,x)>0
nextrow=x;
break
end
end
댓글 수: 0
채택된 답변
the cyclist
2014년 9월 20일
Looks right to me. It is pretty similar to the example in the documentation page for the break command.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
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!