How to find the work of matrixes

How to find the work of matrixes

Matrixes are an effective way of submission of numerical information. The solution of any system of the linear equations can be written down in the form of a matrix (the rectangle made of numbers). Ability to multiply matrixes - one of the most important skills in which train at a course of ""Linear algebra"" in higher educational institutions.

It is required to you

  • Calculator

Instruction

1. At first define whether it is possible to multiply these two matrixes in general. The only condition which has to be carried out for multiplication of matrixes - they have to be proportional. For this purpose the number of columns of the first matrix has to equal to number of lines of the second.

2. For check of this condition it is the simplest to use the following algorithm - write down dimension of the first matrix as (a*b). Farther dimension of the second - (c*d). If b=c - matrixes are proportional, they can be multiplied.

3. Make multiplication further. You remember - at multiplication of two matrixes the new matrix turns out. That is, the problem of multiplication comes down to a problem of finding of elements new, with dimension (a*d). In the SI language the solution of a problem of multiplication of a matrix looks as follows: void matrixmult (int m1 [] [n], int m1_row, int m1_col, int m2 [] [n], int m2_row, int m2_col, int m3 [] [n], int m3_row, int m3_col) {for (int i = 0; i <m3_row; i ++) for (int j = 0; j <m3_col; j ++) m3[i][j]=0; for (int k = 0; k <m2_col; k ++) for (int i = 0; i <m1_row; i ++) for (int j = 0; j <m1_col; j ++) m3[i][k] + = m1[i][j] * m2[j][k]; }

4. In other words, the element of a new matrix is the sum of works of elements of a line of the first matrix on elements of a column of the second matrix. If you find an element of the third matrix with number (1;2), then you have to just increase the first line of the first matrix by the second column second. For this purpose you consider the initial sum of an element equal to zero. You multiply the first element of the first line by the first element of the second column further, you add value to the sum. You do so: you multiply i-ty an element of the first line by i-ty an element of the second column and you add results to the sum, the line will not come to an end yet. Total amount will also be a required element.

5. After you found all elements of the third matrix, write down it. You found the work of matrixes.

Author: «MirrorInfo» Dream Team


Print