matlab switch case 使用。

조회 수: 12 (최근 30일)
svukqfev
svukqfev 2023년 5월 25일
답변: vswsfkrn 2023년 5월 25일
程序内容:
f=input('输入第一个字母(大写字符)')
switch f
case {S}
disp('Sunday')
end
输出:
错误使用 input
函数或变量 'S' 无法识别。
出错 shiyanbaogao5_10 (line 1)
f=input('输入第一个字母(大写字符)')
哪里错了?

채택된 답변

vswsfkrn
vswsfkrn 2023년 5월 25일
f = input( '输入第一个字母(大写字符)', 's' )
switch f
case { 'S' }
disp('Sunday')
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 二维图和三维图에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!