<s>[INST] Understanding matrix multiplication for visualizing what is happening under the hood Take the case of this matrix multiplication:
$$
A x=
\begin{pmatrix} 
1 & -1 & 2\\
0 & -3 & 1\\
\end{pmatrix}
\begin{pmatrix}
2 \\ 1 \\ 0
\end{pmatrix}
$$
The answer of which is
$ 
    \begin{pmatrix}
    1 \\
    -3
    \end{pmatrix}
$.
Source: https://mathinsight.org/matrix_vector_multiplication
I understand there are three components in $A$ and $x.$ So how can matrix multiplication have two (not sure if the component will be the right term) terms as part of the answer leading to matrix multiplication? What is the way to visualize the result? I think with three components, the matrix multiplication should have the result in three parts. I know I am missing something.
 [/INST] We look at the problem by considering two aspects. We start with matrix multiplication and we will see that multiplication of a matrix with a vector can be seen as special case of it. Then we look at how the elements of the product matrix in the current problem are calculated.
Matrix multiplication:

*

*An $(m\times \color{blue}{n})$-matrix $A$ consisting of $m$ rows and $\color{blue}{n\ \mathrm{columns}}$ multiplied with an $(\color{blue}{n} \times q)$-matrix $B$ consisting of $\color{blue}{n\ \mathrm{rows}}$ and $q$ columns gives an $(m\times q)$-matrix $A\cdot B$.


*A vector $x$ of dimension $n$ can be seen as $(\color{blue}{n}\times 1)$ matrix. Multiplication of an $(m\times \color{blue}{n})$-matrix $A$ with $x$ gives $Ax$ which is consequently an $(m\times 1)$ matrix.


*Current problem:
\begin{align*}
A=\begin{pmatrix} 
1 & -1 & 2\\
0 & -3 & 1\\
\end{pmatrix}
\end{align*}
is a $(2\times 3)$ matrix. The vector $x=\begin{pmatrix}
    2 \\
    1\\
 0
    \end{pmatrix}$
is a $(3\times 1)$-matrix and we therefore obtain $Ax$, which is a $(2\times 1)$-matrix.
Elements of the matrix product:

*

*With the settings from above we have $A\cdot B=C=\left(c_{i,j}\right)_{1\leq i\leq m,1\leq j\leq q}$. The element $c_{i,j}$ denotes the element in the $i$-th row and $j$-th column of $C$. We calculate $c_{i,j}$ by multiplying the elements of the $i$-th row and $j$-th column elementwise and adding them up.


We demonstrate this with the current problem. We consider
\begin{align*}
\color{blue}{Ax}
&=\begin{pmatrix} 
1 & -1 & 2\\
0 & -3 & 1\\
\end{pmatrix}
\begin{pmatrix}
2 \\
1 \\
0
\end{pmatrix}\\
\end{align*}
and we know from above that $Ax=(c_{i,j})_{1\leq i\leq 2, 1\leq j\leq 1}$ gives a $(2,1)$-matrix with elements $c_{1,1}$ and $c_{2,1}$.


*

*Element $c_{1,1}$: Multiplication of first row with first column gives
\begin{align*}
\left(\color{blue}{c_{1,1}}\right)&=
\begin{pmatrix} 
1 & -1 & 2\\
\end{pmatrix}
\begin{pmatrix}
2 \\
1 \\
0
\end{pmatrix}\\
&=\left(1\cdot 2+(-1)\cdot 1+2\cdot 0\right)\\
&=(\color{blue}{1})\\
\end{align*}


*Element $c_{2,1}$: Multiplication of second row with first column gives
\begin{align*}
\left(\color{blue}{c_{2,1}}\right)&=
\begin{pmatrix} 
0 & -3 & 1\\
\end{pmatrix}
\begin{pmatrix}
2 \\
1 \\
0
\end{pmatrix}\\
&=\left(0\cdot 2+(-3)\cdot 1+1\cdot 0\right)\\
&=(\color{blue}{-3})\\
\end{align*}
We conclude
\begin{align*}
\color{blue}{Ax}=\begin{pmatrix} 
1 & -1 & 2\\
0 & -3 & 1\\
\end{pmatrix}
\begin{pmatrix}
2 \\
1 \\
0
\end{pmatrix}=
\begin{pmatrix}
c_{1,1} \\
c_{2,1}
\end{pmatrix}\color{blue}{=\begin{pmatrix}
1 \\
-3
\end{pmatrix}}\tag{1}
\end{align*}
Note, with some experience this matrix calculation can be reduced to (1) without doing any intermediate steps.
</s>