logical
Converts a numeric value to logical type.
📝Syntax
Y = logical(X)
📥Input Arguments
Parameter Description
X a numeric value.
📤Output Arguments
Parameter Description
Y a logical value.
📄Description

logical converts a numeric value to logical type.

Nonzero value converted to true and zeros values converted to false.

Complex numbers returns an error.

💡Examples
A = eye(2, 2)
B = logical(A)
islogical(B)
🔗See Also
islogical
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub