How to keep looping a switch statement?

1 次查看(过去 30 天)
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 CenterFile 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