Multiplication of matrices of arbitrary dimension is not defined. The height of one must match the width of another one.
Matrix multiplication is extremely simple (in contrast to division/inversion). Please see, for example:
Matrix multiplication — Wikipedia, the free encyclopedia[
^].
Pay attention,
…if A is an n × m matrix and B is an m × p matrix, their matrix product AB is an n × p matrix, in which the m entries across the rows of A are multiplied with the m entries down the columns of B.
Also note that this is said about the product AB, in the given order. If n≠m or m≠p, multiplication BA is not defined, only AB product can be calculated. Matrix multiplication operator (even for p≡m≡n) is not
commutative.
—SA