|
Mathematical operations
Mathematical operations, including addition, subtraction, multiplication and division, can be performed on matrices and vectors element-wise.
Both matrices or both vectors must be of the same type and must have the same dimensions. Each element of the matrix operates on the corresponding element of the second matrix.
You can also use a scalar of the appropriate type (double, float or complex) as the second term (multiplier, subtrahend or divisor). In this case, each member of the matrix or vector will operate on the specified scalar.
matrix matrix_a={{0.1,0.2,0.3},{0.4,0.5,0.6}};
|
The same operations are available for vectors.