|
Contents | Previous | Next | Subchapters |
| Syntax |
left value < right valueleft value > right valueleft value <= right valueleft value >= right value
|
(less than)
(greater than)
(less than or equal to)
(greater than or equal to)
|
| See Also | logical operators , equality , any , all and string order |
You can compare a matrix with another matrix of the same dimension
or with a scalar.
The result is a logical matrix with the same dimension as
the original matrix.
x = 4
y = 8
print y > x
O-Matrix will respond
T
x = [1, 2, 3, 4, 8]
y = [1, 2, 3, 5, 6]
x < y
O-Matrix will respond
[ F , F , F , T , F ]
because the first three elements of x and y are equal,
the fourth element of x is less than the corresponding
element of y, and the fifth element of x
is greater than the fifth element of y.
x = {[1, 2], [3, 4]}
x <= 2
O-Matrix will respond
{
[ T , T ]
[ F , F ]
}