I have this doubt in matrix multiplication, if i multiply a matrix A1 of [2 * 3] dimension and matrix A2 of dimension [4 * 5] then the matlab will through the error inner dimensions should match. Now I started thinking why should inner dimension should match? Who designed this? What is the reason behind it?
The definition is tedious but really precise. But I think it's the need for linear combinations.
Say we have matrices A (5 by 3) and B (3 by 4) and multiplication C = A * B. A contains 5 row vectors and B contains 4 column vectors. The vectors in B are 4 physical vectors existing in the vector space (R3 as the simplest case) to which B belongs.
Now we want to linearly combine these 4 vectors in 5 different ways to generate 5 new vectors in the same space. We can do either in the following: 1) write the 5 summation equations separately with linear weights as multiplicative coefficients in front of each vector; or 2) define matrix multiplication. It makes life easier, just like 5*5 is a simpler way to express 5+5+5+5+5