Question regarding a switch statement
조회 수: 13 (최근 30일)
이전 댓글 표시
George Drakopoulos
2013년 12월 16일
답변: Michael Dimitroulopoulos
2013년 12월 16일
Can I have multiple types of arguments in a switch statement? Eg
switch n
case 'abc'
% do something
case 4
% do something else
otherwise
end
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2013년 12월 16일
Example
n=input('n=');
switch n
case 'abc'
out=1
case 4
out=2
otherwise
out=3
end
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!