How to keep looping a switch statement?

조회 수: 14 (최근 30일)
Ame Michael
Ame Michael 2018년 4월 25일
답변: Stephen23 2018년 4월 25일
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.

답변 (1개)

Stephen23
Stephen23 2018년 4월 25일
str = '';
while ~strcmp(str,'stop')
...
str = ...
end

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by