Page 84 - MATLAB an introduction with applications
P. 84

MATLAB Basics ——— 69

                   Solution:
                   (a) A = [4 –1 5;  2 1 3;  6 –7 9]
                       A =
                            4  –1    5
                            2    1   3
                            6  –7    9
                       %The eigenvalues of A
                       format short e
                       eig(A)
                       ans =
                             1.0000e + 001
                             5.8579e  – 001
                             3.4142e + 000
                       %The eigenvectors of A
                       [Q,d]=eig(A)
                       Q =
                           –5.5709e – 001      – 8.2886e – 001       – 7.3925e – 001
                           –3.7139e – 001      – 3.9659e – 002       – 6.7174e – 001
                           –7.4278e – 001         5.5805e – 001      – 4.7739e – 002
                       d =
                           1.0000e + 001    0   0
                           0  5.8579e–001 0
                           0            0   3.4142e + 000
                   (b)  A =
                          3    5    7
                          2    4    8
                          5    6   10
                       %The eigenvalues of A
                       format short e
                       eig(A)
                       ans =
                              1.7686e + 001
                            –3.4295e – 001      +1.0066e + 000i
                            –3.4295e – 001      –1.0066e + 000i
                       %The eigenvectors of A
                       [Q,d]=eig(A)
                       Q =
                           Column 1
                                   5.0537e – 001
                                   4.8932e – 001
                                   7.1075e – 001






                   F:\Final Book\Sanjay\IIIrd Printout\Dt. 10-03-09
   79   80   81   82   83   84   85   86   87   88   89