Page 129 - Numerical Analysis Using MATLAB and Excel
P. 129

Determinants



               y=A(1,1)*A(2,2)−A(1,2)*A(2,1);
               %
               % To run this program, define the 2x2 matrix in
               % MATLAB's Command Window as A=[....] and then
               % type det2x2(A) at the command prompt.

               Let   be a matrix of order 3, that is,
                   A

                                                         a 11  a 12  a 13
                                                   A =   a 21  a 22  a 23                              (4.15)

                                                         a 31  a 32  a 33

               then, detA  is found from

                                                  a
                                      detA =   a 11 22 33  +  a 12 23  a 31  +  a 11 22 33
                                                                            a
                                                                         a
                                                     a
                                                             a
                                                              a
                                                a –  11 22  a 33  –  a 11 22  a 33  –  a 11 22  a 33   (4.16)
                                                   a
                                                                         a
               A convenient method to evaluate the determinant of order 3, is to write the first two columns to
               the right of the 3 ×  3  matrix, and add the products formed by the diagonals from upper left to
               lower right; then subtract the products formed by the diagonals from lower left to upper right as
               shown on the diagram of the next page. When this is done properly, we obtain (4.16) above.
                                       a 11  a 12  a 13  a 11  a 12          −

                                       a 21  a 22  a 23  a 21  a 22
                                       a 31  a 32  a 33  a 31  a 32  +

               This method works only with second and third order determinants. To evaluate higher order
               determinants, we must first compute the cofactors; these will be defined shortly.




               Example 4.5
               Compute detA    and detB  given that


                                                  2   3 5              2 – 3 – 4
                                            A =   1   0  1   and B =   1   0 – 2
                                                  2   1 0              0 – 5 – 6
               Solution:








               Numerical Analysis Using MATLAB® and Excel®, Third Edition                             4−11
               Copyright © Orchard Publications
   124   125   126   127   128   129   130   131   132   133   134