Dimensions carry meaning
A matrix with m rows and n columns has shape m × n. Rows and columns may organize coefficients, observations, or a transformation, so identify their meaning before performing an operation.
A matrix-vector product combines entries in a defined order
To multiply a matrix by a column vector, take each row’s dot product with that vector. The number of matrix columns must match the vector’s number of entries, and the result has one entry per matrix row.
A mistake to avoid
Matrix multiplication is not ordinary element-by-element multiplication. The order generally matters, and some reversed products are not defined at all because their dimensions do not match.
Worked example
Multiply A = [[1, 2], [3, 4]] by (5, 6)
Treat (5, 6) as a column vector. The first output is 1 × 5 + 2 × 6 = 17. The second is 3 × 5 + 4 × 6 = 39. Thus the matrix-vector product is the column vector (17, 39).