How to use break in for-if loop to get out of for loop?
    5 次查看(过去 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!

