Because
>> or(1,2)
ans =
logical
1
>>
You're apparently looking for
>> ismember(financial_status,[1,2])
ans =
1×5 logical array
1 1 0 0 0
>>
Rarely are the actual indices returned by find needed, but can be if this is one of those cases that simply using the logical addressing array isn't sufficient.
2 Comments
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/659033-or-in-categorical-variable#comment_1154903
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/659033-or-in-categorical-variable#comment_1154903
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/659033-or-in-categorical-variable#comment_1155093
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/659033-or-in-categorical-variable#comment_1155093
Sign in to comment.