exiting if condition and for loop?

152 次查看(过去 30 天)
for i=1:100
if condition
operations;
else
continue
end
end
here continue will exit out of the if loop but thing is that if else statement executed it should come out of for loop. how can i do that

采纳的回答

per isakson
per isakson 2015-7-18
Try
for i=1:100
if condition
operations;
else
break
end
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by