I have a function I'd like to call for one set of data, update the data, re-run the function... etc. I was thinking I'd use a switch statement for this but it looks like matlab only executes one case; any suggestions? Thanks in advance!

 採用された回答

Walter Roberson
Walter Roberson 2012 年 1 月 24 日

1 投票

Correct, switch() is not a loop; it is a compact if/elseif/elseif/.../end construct . If you want multiple repetitions you need to use a loop, either "while" or "for"

1 件のコメント

Jan
Jan 2012 年 1 月 25 日
See "help switch" and "doc switch".

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Get Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by