0
$\begingroup$

I have a matrix $A$:

$A=\begin{pmatrix} 1 &3 &1\\ 7 &5 &2\\ 4& 3& 7\\ 8& 2& 1\\ 3& 9& 6\\ 4 &5 &2 \end{pmatrix}$

and a matrix $B$:

$\begin{pmatrix} 2& 9& 1\\ 4& 3 &8\\ 9& 7& 3\\ 4& 4& 2\\ 6& 5& 7\\ 2 &9& 2 \end{pmatrix}$

I want to compute $C$:

$\begin{pmatrix} 1\cdot2+3\cdot9+1\cdot1\\ 7\cdot4+5\cdot3+2\cdot8\\ 4\cdot9+3\cdot7+7\cdot3\\ 8\cdot4+2\cdot4+1\cdot2\\ 3\cdot6+9\cdot5+6\cdot7\\ 4\cdot2+5\cdot9+2\cdot2 \end{pmatrix}$

How can I express this purely using matrix operations?

  • 0
    thank you for your responses; i am trying to understand/verify them.2012-05-18

2 Answers 2

1

'Switch' the $B$ matrix around with a transpose: $A B^T$. Let $e_1 = (1,0,0,0,0,0)^T$, $e_2 = (0,1,0,0,0,0)^T$, etc. Then: $C = \sum_{i=1}^6 (e_i^T A B^T e_i)e_i$

  • 0
    If you mean by just products, transpositions and multiplication by constant matrices then I doubt it.2012-05-18
0

From a non-MATLAB perspective, you're just taking the dot product of the rows of each matrix so

$ c_i = \sum_{j=1}^3 a_{ij}b_{ij} $