² Matrix
arithmetic: addition, subtraction, multiplication, and backslash
The common operators including +,
-, and*, applied on real numbers are also available with real matrices. The
operator, named backslash or left division, calculate the solution of A-1B
which represented as A\B. These matrix arithmetic operators are performed on matrix
to matrix operation, and the operation rules are defined by linear algebra. Therefore, the
dimensions of matrices must be the same for additions of matrices, i.e., two m×n matrices or two square matrices.
For multiplication, A is a m-by-n matrix and B is a n-by-m matrix. As for
backslash, A is a m-by-m matrix, and B is a m-by-n matrix.
² Elementwise
operations
To
perform multiplication and backslash element to element, a dot is added before
the operators, *, and \. Because these two elementwise operators, .* and .\,
perform operations on elements directly, the dimensions of A and B are both
m-by-n.
沒有留言:
張貼留言