logical
- :
TF =logical(x)¶ Convert x to a logical array of the same shape.
Zeros become false and every other finite element becomes true. Values that are already logical are returned as-is. Real numeric arrays (including sparse) and single-quoted character arrays are accepted; other types,
NaN, and complex values raise an error (MATLAB:nologicalnan/MATLAB:nologicalcomplex).