matlab switch case 语句不能用?(从书上抄的)程序如下for month =1:12;switchmonthcase{3,4,5} %元胞season='spring'case{6,7,8}season='summer'case{9,10,11}season='autumn'otherwiseseason='winter'endend
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/24 09:03:40
x)M,ILR(.,IPHN,NUx~Ovh|
{:{sٓ]ϺZjy.kz;-H!7?$CbXd`iSlՋ2*tu,j2EKCCC\biIinz~IFjQyfq*L<3'5/lX3~"y[:T/#ByXX(* /r?ɮ> |c[|ɎUWz`Cf~'Ћ6yvP 7ob
matlab switch case 语句不能用?(从书上抄的)程序如下for month =1:12;switchmonthcase{3,4,5} %元胞season='spring'case{6,7,8}season='summer'case{9,10,11}season='autumn'otherwiseseason='winter'endend
matlab switch case 语句不能用?(从书上抄的)
程序如下
for month =1:12;
switchmonth
case{3,4,5} %元胞
season='spring'
case{6,7,8}
season='summer'
case{9,10,11}
season='autumn'
otherwise
season='winter'
end
end
matlab switch case 语句不能用?(从书上抄的)程序如下for month =1:12;switchmonthcase{3,4,5} %元胞season='spring'case{6,7,8}season='summer'case{9,10,11}season='autumn'otherwiseseason='winter'endend
错误在于switch month 中间有一个空格,程序是对的