function y=compare(x)
switch x
case -1
disp('negative one')
case 0
disp('zero')
case 1
disp('positive one')
case 'bei tai tian yuan'
disp('bei tai tian yuan')
otherwise
disp('other value')
end
end
以上按书本输入,运行结果如下:
>> compare分支结构
文件 E:\北太天元文件\compare分支结构.m 中不存在函数 'compare分支结构'。
是何原因?
