Restart code or exit matlab

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 Commenti

Mahi
Mahi il 25 Nov 2018
Modificato: Mahi il 25 Nov 2018
Hi,
When you say code, does it mean a loop/function?
Thanks...
Yixiang Guice
Yixiang Guice il 25 Nov 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 il 25 Nov 2018
I have already answered it. If it is correct then please upvote the answer.

Accedi per commentare.

Risposte (2)

Mahi
Mahi il 25 Nov 2018

1 voto

If CODE here stands for a loop then please refer to the following link:
More infromation can be found here:
Hope this helps!
Thanks..
while true
inner loop stuff goes here
switch expression
case 'restart'
continue %while true loop
case 'terminate'
quit
end
end

Categorie

Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange

Tag

Richiesto:

il 25 Nov 2018

Risposto:

il 25 Nov 2018

Community Treasure Hunt

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

Start Hunting!

Translated by