matrix-vector multiplication The Week 3 lessons in the matrix course of Coding the Matrix: Linear Algebra through Computer Science Applications, it has such example:

Obviously, the matrix is 3*2, and it takes the vector as a 2*1 vector. It seems that the vector can be either row vector or col vector depending on specific situation.
It is right?
 A: For "matrix product" as it is usually meant,
$$\left[\begin{array}{cc}1&2\\3&4\\10&0\end{array}\right] \left[\begin{array}{c}3\\1\end{array}\right]$$ is well defined but
$$\left[\begin{array}{cc}1&2\\3&4\\10&0\end{array}\right] \left[\begin{array}{cc}3&1\end{array}\right]$$
is not.
The "inner dimensions" must match. I.e. number of columns of left matrix must be the same as number of rows of second matrix.
However we can switch places if we transpose each matrix and then multiplication with row vector from the left becomes well defined:
$$\left[\begin{array}{cc}3&1\end{array}\right] \left[\begin{array}{ccc}1&3&10\\2&4&0\end{array}\right]$$
A: In Coding the Matrix, I define matrix-vector multiplication, which operates on a matrix and a vector.  The number of columns of the matrix must match the number of entries of the vector.  You're right that the matrix is 3 by 2, which means that the matrix has 3 rows and 2 columns.  You wouldn't say the vector is 2 by 1 since a vector doesn't have rows or columns.  I call it a 2-vector.  The notation here is nonstandard; it is intended to correspond with the syntax you would use in Python to operate on Mats and Vecs as we implement them in Coding the Matrix.
Later in the unit, after the student has mastered matrix-vector multiplication, the student learns that an n-vector is often interpreted as an n-by-1 matrix, which is called a column vector, and that, with this interpretation, matrix-matrix multiplication (applied to the original matrix and to the column vector) gives the same result as matrix-vector multiplication (applied to the original matrix and to the original vector).
According to this interpretation, the vector written as [3, 1] is represented by the matrix
$$\left[\begin{array}{c}3\\1\end{array}\right]$$
and the matrix-vector product is represented by the matrix-matrix product
$$\left[\begin{array}{cc}1&2\\3&4\\10&0\end{array}\right] \left[\begin{array}{c}3\\1\end{array}\right]$$
This is the more traditional notation.  You'll see as you progress in Coding the Matrix that we mostly use the traditional notation in subsequent units.
