Azzera filtri
Azzera filtri

How to keep looping a switch statement?

1 visualizzazione (ultimi 30 giorni)
Ame Michael
Ame Michael il 25 Apr 2018
Risposto: Stephen23 il 25 Apr 2018
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.

Risposte (1)

Stephen23
Stephen23 il 25 Apr 2018
str = '';
while ~strcmp(str,'stop')
...
str = ...
end

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by