Page 36 - MATLAB an introduction with applications
P. 36

MATLAB Basics ——— 21


                   (d) >> % Let F= transpose of A
                          >> F=A'
                              F =
                                 1    2   –1
                                 0    3    6
                                 1    4    7
                   (e)  >> H = inv (B)
                       H =
                           0.1111      0.0000    –0.2222
                           0.1429     –0.1429      0.5714
                          –0.1746      0.2857    –0.3651

                   ( f ) >> J = B'*A'
                              J =
                                  6   19      4
                                  6   31     40
                                  3   26     41
                   (g)    >> K = A^2 + B^2 – A*B
                                   K =
                                53    52     45
                                15    51     58
                                –2    28     42
                   (h) det (A) = 12
                       det (B) = –63
                       det(A*B)= –756
                   Example E1.2: Determine the eigenvalues and eigenvectors of A and B using MATLAB

                                      4  2  −3          1  2    3
                                     
                                                          
                                              
                                 A =  −1  1  3     and    B =  8  7  6  
                                     
                                                          
                                              
                                      2  5    7        5  3    1 
                                                          
                                     
                   Solution:
                       % Determine the eigenvalues and eigenvectors
                       A = [4 2 –3 ; –1 1 3 ; 2 5 7]
                            A =
                               4    2    –3
                              –1    1     3
                               2    5     7
                       eig(A)
                          ans = 0.5949
                                 3.0000
                                 8.4051








                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   31   32   33   34   35   36   37   38   39   40   41