Operators > Boolean Operators > Logical Operators
Logical Operators
Operator
Description
Keyboard Shortcut
XOR (Exclusive or)—Returns 1 if either x or y, but not both, are true. Returns 0 otherwise.
Ctrl+Shift+%
AND—Returns 1 if both x and y are true. Returns 0 otherwise.
Ctrl+Shift+&
NOT—Returns 1 if x is false. Returns 0 otherwise.
Ctrl+Shift+!
OR—Returns 1 if either x or y are true. Returns 0 otherwise.
Ctrl+Shift+@
Operands
x, y are real or complex scalars. They can also be arrays of equal size if you select the entire expression and insert the vectorize operator to carry out the operation term-by-term.
Additional Information
Operands are true if they are nonzero. They are false if they are equal to zero.
Was this helpful?