主题
:
[求助]switch case语句问题
查看单个帖子
2008-04-23, 11:05
#
1
huyanan008
初级会员
注册日期: 2008-04-22
年龄: 40
帖子: 7
声望力:
0
[求助]switch case语句问题
各位大侠好,菜鸟又来求助了,switch -case-otherwise-end语句中的条件语句可以用逻辑表达式表示吗,比如
function ifzero(x)
switch x
case x>0
fprintf('%d is p\n',x)
case x<0
fprintf('%d is n\n',x)
otherwise
fprintf('%d is z\n',x)
end
为什么ifzero(8)的结果是8 is z
谢谢各位大侠的帮助
huyanan008
查看公开信息
发送悄悄话给 huyanan008
查找 huyanan008 发表的更多帖子