Case statements

2 次查看(过去 30 天)
Natasha
Natasha 2012-1-24
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
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 个)

类别

Help CenterFile 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