How to keep looping a switch statement?

1 visualización (últimos 30 días)
Ame Michael
Ame Michael el 25 de Abr. de 2018
Respondida: Stephen23 el 25 de Abr. de 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.

Respuestas (1)

Stephen23
Stephen23 el 25 de Abr. de 2018
str = '';
while ~strcmp(str,'stop')
...
str = ...
end

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by