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

Mahi
Mahi 2018년 11월 25일
편집: Mahi 2018년 11월 25일
Hi,
When you say code, does it mean a loop/function?
Thanks...
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일

1 개 추천

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일

1 개 추천

while true
inner loop stuff goes here
switch expression
case 'restart'
continue %while true loop
case 'terminate'
quit
end
end

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

질문:

2018년 11월 25일

답변:

2018년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by