logical
Converts x to a logical type.
Syntax
logical(x)
Inputs
- x
 - A numeric value.
 
Outputs
- R
 - Either true (1) or false (0). The numeric value 0 goes to false, while every other numeric value goes to true.
 
Examples
logical(10)ans = 1logical(0)ans = 0logical(NaN)Error: cannot convert NaN to logical