Source: Internet
Author: User

First, Mmult theoretical knowledge

function function: Returns the sum of the product of the matrices of two arrays. The result matrix has the same number of rows as the array1, and the number of columns in the matrix is the same as the number of array2 columns.

Grammar

Mmult (Array1,array2)

Array1, Array2 is a two array of matrix multiplication operations.

Parameter description

Using the Mmult function, you need to know the following three points:

① First judge whether two matrices can do multiplication, judge method: The number of columns in array 1 must be equal to the number of rows in array 2.

② know how the matrix is multiplied. The number of rows calculated is the same as the number of rows Array1 or the number of columns calculated is the same as the number of Array2 columns.

The ③mmult matrix can contain only numeric values, any cells that are empty or contain text will return an error value #VALUE!.

Mmult do not use the three-key end is the 1th row of the 1th column number, with the three-key end is an array; Mmult as other function parameters is an array to participate in the operation, do not need three key to end.

The process of multiplying the Mmult two matrices is to multiply the elements of the first parameter by the corresponding elements of the second parameter, and then add the results to the final result.

Second, Mmult calculation process detailed

First we look at the table below.

By the table above, we cannot find that there are two arrays, one is: {1,2,3} three values, and array two is: {1,2,3} three values.

Of course, if we're going to use formulas to compute these two arrays, then the function of the formula is: =mmult (B1:D1,A2:A4)

So, exactly how does mmult calculate? then look down.

According to the above functional theory knowledge, we are not difficult to find, should be:

The first value of the first array is multiplied by the first value of the second array, the second value of the first array multiplied by the second value of the second array, and the third value of the first array multiplied by the third value of the second array ... The nth value of the first array is multiplied by the nth value of the second array

① First Step calculation

The first value of the first array is multiplied by the first value of the second array, that is, the B1 times the A2 of the following figure, that is, the 1x1 equals 1

② Second Step calculation

The second value of the first array is multiplied by the second value of the second array, that is, the C1 times the A3 of the following figure, i.e. 2x2 equals 4

③ Third Step calculation

The third value of the first array is multiplied by the third value of the second array, that is, the D1 times the A4, which is the 3x3 equals 9

This is the computational process of the Mmult function.

After the product of the three steps is finished, the function will add up the result according to the theory of calculation, namely 1+4+9=14

Knowing the calculation process of the function, we look at the results of using the Mmult function directly.

Computer Tutorials

The figure shows that the result is 14, which is consistent with the results obtained from the derivation process. The use of Mmult functions is simple but highly practical, and will be used in many statistical jobs, such as calculating profit margins, calculating profits and losses, and will be widely used

Related Article