What is this solution of matrices called?

83 Views Asked by At

I have the solution to a problem here. $$ \begin{bmatrix} 5 & 2 & 7 \\ 1 & 1 & 3 \\ 9 & 0 & 2 \\ \end{bmatrix} \cdot \begin{bmatrix} 0 & 1 & 5 \\ 9 & 1 & 9 \\ 2 & 2 & 6 \\ \end{bmatrix} $$

That gives a result of

\begin{bmatrix} 27 & 3 & 74 \\ \end{bmatrix}

What exactly is happening here? Please help! Why isn't the solution a $3 \times 3$ matrix?

2

There are 2 best solutions below

4
On BEST ANSWER

In Matlab, the dot function treats A and B as collections of column vectors.

The first column of A is $\vec{A_1}=(5,1,9)$, the first column of B is $\vec{B_1}=(0,9,2)$, hence the dot product $\vec{A_1}\cdot \vec{B_1}=27$ and so on, giving the total result $A\cdot B =(27, 3, 74)$ which is NOT the matrix product

You are probably looking for the operation A*B which gives the matrix product of A and B.

4
On

I don't know what kind of multiplication is this but when you multiply normally you should get a 3 cross 3 matrix $$A=\begin{bmatrix} 5 & 2 & 7 \\ 1 & 1 & 3 \\ 9 & 0 & 2 \\ \end{bmatrix}$$ $$B=\begin{bmatrix} 0 & 1 & 5 \\ 9 & 1 & 9 \\ 2 & 2 & 6 \\ \end{bmatrix}$$

They are multiplying the first column of the matrix A with the first column of the matrix B element by element and adding them

Similarly the second column of matrix A with the second column of matrix B

$$5\cdot0+1\cdot9+9\cdot2=27$$ $$2\cdot1+1\cdot1+0\cdot2=3$$ $$7\cdot5+3\cdot9+2\cdot6=74$$ $$\begin{bmatrix} 27 & 3 & 74 \\ \end{bmatrix}$$

When you multiply matrix A with matrix B you should get

$$A*B=\begin{bmatrix} 32 & 21 & 85 \\ 15 & 8 & 32 \\ 4 & 13 & 57 \\ \end{bmatrix}$$