The MMULT function in Excel is used to perform matrix multiplication. It returns the matrix product of two arrays. The number of columns in the first array must be equal to the number of rows in the second array, and the resulting array will have the same number of rows as the first array and the same number of columns as the second array.
Syntax
MMULT(array1, array2)
array1
: The first array or range to multiply.array2
: The second array or range to multiply.
Example
Suppose you have two matrices and you want to multiply them using the MMULT function.
Data
Matrix 1 (A1):
A | B | |
---|---|---|
1 | 1 | 2 |
2 | 3 | 4 |
Matrix 2 (D1):
D | E | |
---|---|---|
1 | 5 | 6 |
2 | 7 | 8 |
You want to calculate the matrix product of these two matrices.
Steps
Enter the first matrix in cells A1
and the second matrix in cells D1.Select the range where you want to display the result, which will be a 2x2 matrix. Select cells F1
.Enter the MMULT formula:
=MMULT(A1:B2, D1:E2)
Press
Ctrl+Shift+Enter
to enter the formula as an array formula. Excel will automatically enclose the formula in curly braces{}
.
Explanation of the Formula
A1:B2
is the first matrix (2 rows by 2 columns).D1:E2
is the second matrix (2 rows by 2 columns).
Calculation
Matrix multiplication is performed as follows:
Result
F | G | |
---|---|---|
1 | 19 | 22 |
2 | 43 | 50 |
The resulting matrix (F1) is:
19 22 43 50
By using the MMULT function, you can easily perform matrix multiplication in Excel, which is particularly useful for various mathematical and engineering applications.
No comments:
Post a Comment