Matrix times vector blends the columns
Here is the picture that makes everything click. To compute A times a vector x, take the numbers in x as weights, multiply each column of A by its weight, and add the results. The output is a blend of A's columns.
[[2,0],[0,3]] * (1,1) = 1*(2,0) + 1*(0,3) = (2,0) + (0,3) = (2,3)
Matrix times matrix = do one, then the other
Matrix times matrix is just this idea, repeated. Reading both matrices as machines, the product A*B means: send a vector through B first, then through A. That chaining is called composition. So A*B applied to x equals A applied to (B applied to x).
- Read A*B right-to-left: B happens first, A happens second.
- Column j of the product is A applied to column j of B.
- Stack those output columns side by side — that is the product matrix.
Shapes must match, and order matters
You can only multiply A*B when A's column count equals B's row count: (m-by-n) times (n-by-p) gives (m-by-p). The two inner numbers must agree and then cancel out. If they do not agree, the product simply does not exist.
A=[[0,-1],[1,0]] (rotate) B=[[2,0],[0,1]] (stretch) A*B = [[0,-1],[2, 0]] B*A = [[0,-2],[1, 0]] <- different!
The matrix that does nothing
The identity matrix I has 1s down the diagonal and 0s everywhere else. Multiplying by it leaves a vector or matrix untouched: I*x = x and A*I = A. It is the number 1 of the matrix world — the do-nothing machine.
[[1,0],[0,1]] * (5,7) = (5,7) <- unchanged