stop for loop if a thing happens
4 次查看(过去 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!