for example:
for i=1:10
a=i+1
if a>5
exit from loop % *which command do this*
end
end

 採用された回答

Jan
Jan 2011 年 9 月 8 日

1 投票

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.

その他の回答 (2 件)

Wesley Ooms
Wesley Ooms 2011 年 9 月 8 日

0 投票

the command is 'return' i guess
Wesley Ooms
Wesley Ooms 2011 年 9 月 8 日

0 投票

i looked it up for you. the command is 'break' :)

2 件のコメント

Oleg Komarov
Oleg Komarov 2011 年 9 月 8 日
@Weasley: please edit your answers in place of creating new ones.
feras almasri
feras almasri 2015 年 4 月 4 日
plz answer him instead of saying this

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

質問済み:

2011 年 9 月 8 日

コメント済み:

2015 年 4 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by