Difference between revisions of "Manuals/calci/MMULT"
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
==ZOS Section== | ==ZOS Section== | ||
*The syntax is to calculate MMULT in ZOS is <math>MMULT(a,b)</math> | *The syntax is to calculate MMULT in ZOS is <math>MMULT(a,b)</math> | ||
+ | **where <math>a</math> and <math>b</math> are the array of two matrices. | ||
+ | *For e.g., | ||
==Examples== | ==Examples== |
Revision as of 23:22, 8 June 2014
MMULT(a,b)
- where and are the array of two matrices
Description
- This function gives product of two matrices.
- Matrix multiplication is of two types:
Type 1: A scalar (a constant) is multiplied with the each element of the matrix. Type 2: Multiplication of two matrices.
- We can do the matrix multiplication when the number of columns in the first matrix equals the number of rows in the second matrix.
- For e.g. 4x2 matrix can multiply with 2x3. The matrix product of two arrays and is: where is the row number and is the column number.
- i.e Multiply the elements of each row of 1st matrix by elements of each column of 2nd matrix.
- So the resultant matrix is of the order: Rows of 1st matrix × Columns of 2nd.
- For e.g If we multiply a 4x2 matrix with a 2x3 matrix, the product matrix is of order 4x3.
- Matrix multiplication satisfies the associative and distributive properties.
- But it is not satisfies the commutative property.
- This function will give the result as error when:
The number of columns in the 1st matrix is not equal to number of rows in the 2nd matrix. In the range cell, any cells are empty or that should not be convert in to numbers.
ZOS Section
- The syntax is to calculate MMULT in ZOS is
- where and are the array of two matrices.
- For e.g.,
Examples
- Example 1
A | B | C | D | E | |
---|---|---|---|---|---|
1 | 5 | 7 | 8 | ||
2 | 7 | 4 | |||
3 | 8 | ||||
4 | 4 | -5 | 9 | ||
5 |
From the above table values:
15 | 21 | 24 |
24 | -30 | 54 |
- Example 2
7 | 5 |
2 | 3 |
6 | 0 |
9 | 8 |
8 | -4 | 11 |
2 | 7 | 5 |
- Here Matrix A is of order 4x2 and Matrix B is of order 2x3.
- So the Product Matrix is of order 4x3. i.e
- 1st Row 7*8+5*2 = 66 ; 7*(-4)+5*7 = 7 ; 7*11+5*5 = 102
- 2nd Row 2*8+3*2 = 22 ; 2*(-4)+3*7 = 13 ; 2*11+3*5 = 37 and so on