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!