How to keep looping a switch statement?

2 ビュー (過去 30 日間)
Ame Michael
Ame Michael 2018 年 4 月 25 日
回答済み: Stephen23 2018 年 4 月 25 日
How can I keep looping a switch statement until the user types the word "stop"?
I want the switch to keep looping through the cases until the user types "stop", to which the loop will break.

回答 (1 件)

Stephen23
Stephen23 2018 年 4 月 25 日
str = '';
while ~strcmp(str,'stop')
...
str = ...
end

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by