|MATLAB Function Reference|
The relational operators are
~=. Relational operators perform element-by-element comparisons between two arrays. They return a
logical array of the same size, with elements set to logical
true) where the relation is true, and elements set to logical
false) where it is not.
>= use only the real part of their operands for the comparison. The operators
~= test real and imaginary parts.
To test if two strings are equivalent, use
strcmp, which allows vectors of dissimilar length to be compared.
For some toolboxes, the relational operators are overloaded, that is, they perform differently in the context of that toolbox. To see the toolboxes that overload a given operator, type |
If one of the operands is a scalar and the other a matrix, the scalar expands to the size of the matrix. For example, the two pairs of statements
produce the same result:
Elementwise Logical Operators,
|, Short-Circuit Logical Operators,
|Arithmetic Operators + - * / \ ^ '||Logical Operators: Elementwise & | ~|
© 1994-2005 The MathWorks, Inc.