C(i, j) = ∑
k = 1
n
A(i, k)B(k, j) .
To see this, you can calculate the product of two matrices.
A = [1 3;2 4]
A =
1
3
2
4
B = [3 0;1 5]
B =
3
0
1
5
A*B
ans =
6
15
10
20
The previous matrix product is not equal to the following element-wise product.
A.*B
ans =
3
0
2
20
The following table provides a summary of matrix arithmetic operators in MATLAB. For functionspecific information, click the link to the function reference page in the last column.
Operator
Purpose
Description
Reference
Page
*
Matrix
multiplication
C = A*B is the linear algebraic product of the
matrices A and B. The number of columns of A
must equal the number of rows of B.
mtimes
\
Matrix left
division
x = A\B is the solution to the equation Ax = B.
Matrices A and B must have the same number of
rows.
mldivide
/
Matrix right
division
x = B/A is the solution to the equation xA = B.
Matrices A and B must have the same number of
columns. In terms of the left division operator,
B/A = (A'\B')'.
mrdivide
^
Matrix power
A^B is A to the power B, if B is a scalar. For other
values of B, the calculation involves eigenvalues
and eigenvectors.
mpower
Array vs. Matrix Operations
2-23
Précédent

- 73/1450

Suivant