logical
Convert the elements of an array to boolean valued elements.
y=logical(a)
Inputs
a A numeric array.
Outputs
y An array of the same size as a , with each of its elements being 1 or 0 depending on whether or not the corresponding element of the input is nozero.


Example
>>a=[1 0 2 3; 0  4 2 5;6 8 0 0]
>>a
          1          0          2          3
          0          4          2          5
          6          8          0          0

>>logical(a)
          1          0          1          1
          0          1          1          1
          1          1          0          0