Restart code or exit matlab

13 ビュー (過去 30 日間)
Yixiang Guice
Yixiang Guice 2018 年 11 月 25 日
回答済み: Walter Roberson 2018 年 11 月 25 日
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 件のコメント
Yixiang Guice
Yixiang Guice 2018 年 11 月 25 日
my program actually consist of a while loop and switch case. the switch case is placed after i ended the while loop
Mahi
Mahi 2018 年 11 月 25 日
I have already answered it. If it is correct then please upvote the answer.

サインインしてコメントする。

回答 (2 件)

Mahi
Mahi 2018 年 11 月 25 日
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 2018 年 11 月 25 日
while true
inner loop stuff goes here
switch expression
case 'restart'
continue %while true loop
case 'terminate'
quit
end
end

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by