Simulink Reference Previous page   Next Page

Logical Operators in Embedded MATLAB Functions

Embedded MATLAB functions support the following elementwise logical operators between matrix operands (maximum two-dimensional) of type double or single of the same size. See Logical Operators, Element-wise & | ~ and Logical Operators, Short-circuit && || in MATLAB online help for detailed descriptions of each operation and any requirements for the data types of the operands.

Operation
Description
&
Logical AND
This & operator is limited to use outside if and while statement conditions. In its place, use the && operator. To logically collapse vectors into scalars, use the Embedded MATLAB function all.
|
Logical OR
This | operator is limited to use outside if and while statements. In its place, use the || operator. To logically collapse vectors into scalars use, the Embedded MATLAB function all.
-
Element complement
xor
Logical XOR
&&
Logical AND (short-circuiting)
||
Logical OR (short-circuiting)


Previous page  Relational Operators in Embedded MATLAB Functions Embedded MATLAB Run-Time Function Library Next page

© 1994-2005 The MathWorks, Inc.