How to use break in for-if loop to get out of for loop?

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

 Accepted Answer

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Asked:

on 20 Sep 2014

Answered:

on 20 Sep 2014

Community Treasure Hunt

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

Start Hunting!