作业帮 > 综合 > 作业

执行出错:Error:File:C:\MATLAB7\work\sta.m Line:4 Column:32 Incom

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/21 23:38:53
执行出错:Error:File:C:\MATLAB7\work\sta.m Line:4 Column:32 Incomplete or misformed expres
function snext = sta(a)
switch a
case 0:
snext=4
case 1:
snext=1
case 2:
snext=1
case 3:
snext=2
otherwise:
snext=1
end
保存为sta.m文件
然后在matlab中调用sta(1)
执行出错:
Error:File:C:\MATLAB7\work\sta.m Line:4 Column:32
Incomplete or misformed expression or statement.
什么原因啊?
function snext = sta(a)
switch a
case 0
snext=4
case 1
snext=1
case 2
snext=1
case 3
snext=2
otherwise
snext=1
end