Next: , Previous: , Up: Matrix Expressions   [Contents][Index]


16.4.1.5 Elementwise Binary Operators

The elementwise binary operators require their operands to be matrices with the same dimensions. Alternatively, if one operand is a scalar, then its value is treated as if it were duplicated to the dimensions of the other operand. The result is a matrix of the same size as the operands, in which each element is the result of the applying the operator to the corresponding elements of the operands.

The elementwise binary operators are listed below.

Examples:

1 + 23
1 + {3; 4}{4; 5}
{66, 77; 88, 99} + 5{71, 82; 93, 104}
{4, 8; 3, 7} + {1, 0; 5, 2}{5, 8; 8, 9}
{1, 2; 3, 4} < {4, 3; 2, 1}{1, 1; 0, 0}
{1, 3; 2, 4} >= 3{0, 1; 0, 1}
{0, 0; 1, 1} AND {0, 1; 0, 1}{0, 0; 0, 1}

Next: Matrix Multiplication Operator ‘*, Previous: Unary Operators, Up: Matrix Expressions   [Contents][Index]