Suppose A is a pxq matrix and B is an rxs matrix.
Then C = AxBis defined only if q = r: that is the number of columns in A is the same as the number of rows in B. The result is then a pxs matrix.
Suppose the element in the wth row and xth column of A is awx.
Similarly, let the element in the yth row and zth column of B is byz.
Then the element in the ith row and jth column of C is
ai1b1j + ai2b2j + ... + aiqbqj where i = 1, 2, ..., p and j = 1, 2, ..., q.
There are further rules for matrix multiplication.
It is not commutative: in fact B*A may not even exist.
It is associative. Provided they exist, A*(B*C) = (A*B)*C
It is distributive over addition: Provided they exist, A*(B+C) = A*B + A*C
and (B*C)*D = B*C + B*D.
Chat with our AI personalities
A matrix is a rectangular array of elements. These elements are usually numbers but need not be. Matrices follow special rules for basic mathematical manipulation (addition and multiplication).
ghanto
The matrix multiplication in c language : c program is used to multiply matrices with two dimensional array. This program multiplies two matrices which will be entered by the user.
Tthe matrix multiplication A*Bis defined only if the number of columns in the first matrix, A, is the same as the number of rows in the second, B. Note that the condition for the multiplication of B*A will be the reverse.
scalar multiplication