break statement after if loop inside a for loop..
3 次查看(过去 30 天)
显示 更早的评论
Hi..I have doubt if we are using an if loop inside a for loop followed by a break ,whether the break function will break if loop or for loop ..for example..
for i=1:100
if (statement1)
a=b
break
end
if (statement2)
b=c
in this which loop break will break ..if or for loop..
thanks
0 个评论
采纳的回答
Matt J
2014-9-15
The break will exit the for-loop. if...end's are not loops.
5 个评论
Image Analyst
2014-9-15
Don't use a { before the code or a q} after the code. Other than that it should work, and the only problem is that you haven't read this: http://www.mathworks.com/matlabcentral/answers/13205-tutorial-how-to-format-your-question-with-markup
更多回答(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!