I'm trying to execute a block of code if one of several conditions is met. Again, for clarity, if any of the conditions are true, I'd like for the code to execute (chain of logical ORs).
When I type this code into Matlab:
if strmatch(T,'Sd') || strmatch(T,'SuperDev') || ...
strmatch(T,'lrnTrialVD') || strmatch(T,'lrnTrialVIS') || ...
strmatch(T,'lrnTrialTARGET') || strmatch(T,'lrnTrialAUD')
I get this error:
??? Operands to the || and && operators must be convertible to logical scalar values.
Can someone please tell me where I've gone wrong?
/blz
EDIT: I used the wrong function. strcmp is what I meant to use!
strmatch, and even have a cell array for all your strings, but you need to useanyaround thestrmatchcall.