Restart code or exit matlab

58 visualizaciones (últimos 30 días)
Yixiang Guice
Yixiang Guice el 25 de Nov. de 2018
Respondida: Walter Roberson el 25 de Nov. de 2018
Is there any way I can prompt the user to choose whether to restart the code or to exit Matlab.
The part where I need this code to work is after I print out the result using the switch case.
  3 comentarios
Yixiang Guice
Yixiang Guice el 25 de Nov. de 2018
my program actually consist of a while loop and switch case. the switch case is placed after i ended the while loop
Mahi
Mahi el 25 de Nov. de 2018
I have already answered it. If it is correct then please upvote the answer.

Iniciar sesión para comentar.

Respuestas (2)

Mahi
Mahi el 25 de Nov. de 2018
If CODE here stands for a loop then please refer to the following link:
More infromation can be found here:
Hope this helps!
Thanks..

Walter Roberson
Walter Roberson el 25 de Nov. de 2018
while true
inner loop stuff goes here
switch expression
case 'restart'
continue %while true loop
case 'terminate'
quit
end
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