A problem of elementary logic?
You want an error to return only if A is not in the set {'A','B'}. So a call to ismember might be a good alternative.
Regardless, given the approach you have followed, if x is equal to 'A', then the second half of the clause will be true, even though the first part of the clause is false. And the logical statement
is TRUE.
You are asking for a result that is only true when BOTH parts of the clause are true. Use a logical and, NOT a logical or.
0 Comments
Sign in to comment.