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 日

0 投票

Try
for i=1:100
if condition
operations;
else
break
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および 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!

Translated by