MATLAB: How to use logical “OR” operation for comparing string?

logical operationsstrings

I tried with the code as given:
strcmp('normal'||'neptune',{'normal'; 'DoS'; 'neptune'; 'R2L'})
and the error is saying that the OR "||" operator must be convertible to logical scalar values. So, what could be the possible solution to this?? thanks in advance.

Best Answer

any( ismember({'normal', 'neptune'}, {'normal'; 'DoS'; 'neptune'; 'R2L'}) )
Related Question