You are on page 1of 2

ENGRD 241: Engineering Computation

Fall 2002

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

A B C D ENGRD 241. Example of Matrix Operations in Excel Operations: MDETERM(array) MINVERSE(array) MMULT(array1,array2) TRANSPOSE(array)

calculates determinate of square matrix calculates inverse of square matrix performs matrix multiplication calculates transpose

An array is specified by upper left and lower right cells (see examples). All operations must be conformable. Formulas involving arrays are entered by: 1) Selecting an appropriately sized array area for the result array. (i.e., highlight the entire area from upper left to lower right.)

2) Type in the formula. e.g., to Multiply a 3x3 matrix with a 3x1 vector the command you 17 type would look like: 18 =MMULT(B22:D24,E22:E24) 19 20 3) Type: Shift + Control + Enter (PC) 21 Command + Enter (Macintosh) 22 The array formula will appear in all the cells of the array. Formulas are 23 surrounded by { } by Excel (automatically). [User does NOT type the { }.] 24 25 Entered data for numerical example of [A]{x} = {b}: 26 27 A= 2 1 0 28 (B27:D29) -1 3 -1 29 0 -1 4 30 31 b= 1 32 (B31:B33) 2 33 3 34 Calculated data for numerical example (examine formulas by clicking cells 35 here or looking at the next sheet): 36 37 x= 0 38 1 39 1 40 41 A inverse = 0.4231 -0.1538 -0.0385 42 0.1538 0.3077 0.0769 43 0.0385 0.0769 0.2692 44 Note that element-by-element array multiplication is also possible. The procedure is similar, but the command is the standard Excel multiply command. For example, element-by-element array multiplication of the Matrix 45 [A] * [A] yields: 46 47 4 1 0 48 1 9 1 49 0 1 16 50 51 Matrix multiplication of [A][A] gives: 52 53 3 5 -1 54 -5 9 -7 55 1 -7 17

Page 1 of 2

ENGRD 241: Engineering Computation

Fall 2002

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22

A B C ENGRD 241. Example of Matrix Operations in Excel Operations: MDETERM(array) MINVERSE(array) MMULT(array1,array2) TRANSPOSE(array)

calculates determinate of square matrix calculates inverse of square matrix performs matrix multiplication calculates transpose

An array is specified by upper left and lower right cells (see examples). All operations must be conformable. Formulas involving arrays are entered by: 1) Selecting an appropriately sized array area for the result array. (i.e., highlight the entire area from upper left to lower right.) 2) Type in the formula. e.g., to Multiply a 3x3 matrix with a 3x1 vector the command you type would look like: =MMULT(B22:D24,E22:E24) 3) Type: Shift + Control + Enter Command + Enter (PC) (Macintosh)

The array formula will appear in all the cells of the array. Formulas are surrounded by { } by 23 Excel (automatically). [User does NOT type the { }.] 24 25 Entered data for numerical example of [A]{x} = {b}: 26 27 A= 2 1 0 28 (B27:D29) -1 3 -1 29 0 -1 4 30 31 b= 1 32 (B31:B33) 2 33 3 34 35 Formulas for calculated data for numerical example: 36 37 x= =MMULT(MINVERSE(C27:E29),(C31:C33)) 38 =MMULT(MINVERSE(C27:E29),(C31:C33)) 39 =MMULT(MINVERSE(C27:E29),(C31:C33)) 40 41 A inverse = =MINVERSE(C27:E29) =MINVERSE(C27:E29) =MINVERSE(C27:E29) 42 =MINVERSE(C27:E29) =MINVERSE(C27:E29) =MINVERSE(C27:E29) 43 =MINVERSE(C27:E29) =MINVERSE(C27:E29) =MINVERSE(C27:E29) 44 Note that element-by-element array multiplication is also possible. The procedure is similar, but the command is the standard Excel multiply command. For example, element-by-element array multiplication of the Matrix [A] * [A] has the 45 following formulas: 46 47 =C27:E29*C27:E29 =C27:E29*C27:E29 =C27:E29*C27:E29 48 =C27:E29*C27:E29 =C27:E29*C27:E29 =C27:E29*C27:E29 49 =C27:E29*C27:E29 =C27:E29*C27:E29 =C27:E29*C27:E29 50 51 Matrix multiplication of [A][A] has the following formulas: 52 53 =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29) 54 =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29) 55 =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29) =MMULT(C27:E29,C27:E29)

Page 2 of 2

You might also like