为什么不能在if语句中链接逻辑比较?
10LK
如果满足以下条件之一,我将尝试执行代码块。再次,为清楚起见,如果满足任何条件,我希望代码执行(逻辑或链)。
当我在Matlab中键入以下代码时:
if strmatch(T,'Sd') || strmatch(T,'SuperDev') || ... strmatch(T,'lrnTrialVD') || strmatch(T,'lrnTrialVIS') || ... strmatch(T,'lrnTrialTARGET') || strmatch(T,'lrnTrialAUD')
我收到此错误:
??? Operands to the || and && operators must be convertible to logical scalar values.
有人可以告诉我我哪里出问题了吗?
/ blz
编辑:我使用了错误的功能。我要使用strcmp!
请先登陆或注册
暂无回答!