Operators > Boolean Operators > Comparison Operators
  
Comparison Operators
Operator
Description
Keyboard Shortcut
Returns 1 if x is an element of the number set y, returns 0 otherwise.
Returns 1 if x is equal to y, 0 otherwise.
Returns 1 if x is greater than y, 0 otherwise.
>
Returns 1 if x is greater than or equal to y, 0 otherwise.
>=
Ctrl+0
Returns 1 if x is less than y, 0 otherwise.
<
Returns 1 if x is less than or equal to y, 0 otherwise.
<=
Ctrl+9
Returns 1 if x is not equal to y, 0 otherwise.
< >
Operands
x, y are real or imaginary scalars, vectors or matrices, or strings. x and y must be of the same type. If x and y are arrays, they must have the same number of rows and columns.
Additional Information
The comparison operators are affected by the worksheet’s Calculation Options.
Apart from ≠ and Є, you can use the comparison operators for specifying constraints in solve blocks.
The equal to operator is useful for defining expressions that you do not wish to evaluate, as it does not yield a result until an evaluation operator is applied.
When a scalar is compared to an array, or when two arrays are compared to each other, the comparison is performed element-wise.
String comparisons result in alphabetical sorting.
To compare term-by-term two arrays of equal size, select the entire expression and insert the vectorize operator.