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

Chapter 4  Matrices and Determinants


                                                                                        *
                † The sum of the diagonal elements of a square matrix   is called the trace  of  .
                                                                     A
                                                                                            A
                † A matrix in which every element is zero, is called a zero matrix.
                4.2 Matrix Operations


                Two matrices A =    a ij   and B =  b ij   are equal, that is, A =  B , if and only if


                                                             ,
                                                                               ,
                                                      ,,,
                                                                                   ,
                                                                           ,,
                                   a =   b ij    i =  1 2 3 … m       j =  123 … n                      (4.2)
                                    ij
                Two matrices are said to be conformable for addition (subtraction), if they are of the same order
                m ×   . n
                If A =  a ij   and B =  b ij   are conformable for addition (subtraction), their sum (difference) will
                be another matrix   with the same order as   and  , where each element of   is the sum (dif-
                                                                  B
                                  C
                                                                                            C
                                                           A
                ference) of the corresponding elements of   and  , that is,
                                                                B
                                                         A
                                                 C =  A ± B =  [  a ±  b ]  ij                          (4.3)
                                                                 ij
                Example 4.1

                Compute A +   B  and A –  B  given that


                                              A =   123     and B =    23 0
                                                    01 4              – 1 25
                Solution:



                                         A +  B =  1 +  2  2 +  3  3 +  0  =  35  3
                                                  0 –  1  1 + 2  4 + 5    – 1 3   9
                and

                                                                   –
                                                                              –
                                                    –
                                         A –  B =  12     2 –  3  30   =  – 1 1 3
                                                                                 –
                                                   0 +  1  1 –  2 4 –  5   1 – 1 1
                Check with MATLAB:

                A=[1  2  3;   0  1  4];  B=[2  3  0; −1  2  5];   % Define matrices A and B
                A+B                                        % Add A and B

                * Henceforth, all paragraphs and topics preceded by a dagger ( † ) may be skipped. These are discussed in matrix theory text-
                   books.


               4−2                              Numerical Analysis Using MATLAB® and Excel®, Third Edition

                                                                             Copyright © Orchard Publications
   115   116   117   118   119   120   121   122   123   124   125