高斯消元法求特征值

e=sym(‘e‘)
E=[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1]
E=e.*E
A=[1,-1,1,-4;5,-4,3,12;2,1,1,11;2,-1,7,-1]
A=A-E
Adet=1
%开始消元过程
for k=1:(length(A))
   a=A(k,k)
   Adet = Adet.*a
   for i=1:(length(A))
      A(k,i)=A(k,i)/a
   end
   for i=k+1:(length(A))
      c=-A(i,k)
	  for j=1: (length(A))
		A(i,j)=A(i,j)+c.*A(k,j)
	  end
   end
end
Adet
Adet=solve(Adet)
Adet=double(Adet)

e =

e

E =

     1     0     0     0
     0     1     0     0
     0     0     1     0
     0     0     0     1

E =

[ e, 0, 0, 0]
[ 0, e, 0, 0]
[ 0, 0, e, 0]
[ 0, 0, 0, e]

A =

     1    -1     1    -4
     5    -4     3    12
     2     1     1    11
     2    -1     7    -1

A =

[ 1 - e,      -1,     1,      -4]
[     5, - e - 4,     3,      12]
[     2,       1, 1 - e,      11]
[     2,      -1,     7, - e - 1]

Adet =

     1

a =

1 - e

Adet =

1 - e

A =

[ 1,      -1,     1,      -4]
[ 5, - e - 4,     3,      12]
[ 2,       1, 1 - e,      11]
[ 2,      -1,     7, - e - 1]

A =

[ 1, 1/(e - 1),     1,      -4]
[ 5,   - e - 4,     3,      12]
[ 2,         1, 1 - e,      11]
[ 2,        -1,     7, - e - 1]

A =

[ 1, 1/(e - 1), -1/(e - 1),      -4]
[ 5,   - e - 4,          3,      12]
[ 2,         1,      1 - e,      11]
[ 2,        -1,          7, - e - 1]

A =

[ 1, 1/(e - 1), -1/(e - 1), 4/(e - 1)]
[ 5,   - e - 4,          3,        12]
[ 2,         1,      1 - e,        11]
[ 2,        -1,          7,   - e - 1]

c =

-5

A =

[ 1, 1/(e - 1), -1/(e - 1), 4/(e - 1)]
[ 0,   - e - 4,          3,        12]
[ 2,         1,      1 - e,        11]
[ 2,        -1,          7,   - e - 1]

A =

[ 1,           1/(e - 1), -1/(e - 1), 4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,          3,        12]
[ 2,                   1,      1 - e,        11]
[ 2,                  -1,          7,   - e - 1]

A =

[ 1,           1/(e - 1),    -1/(e - 1), 4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4, 5/(e - 1) + 3,        12]
[ 2,                   1,         1 - e,        11]
[ 2,                  -1,             7,   - e - 1]

A =

[ 1,           1/(e - 1),    -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4, 5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 2,                   1,         1 - e,              11]
[ 2,                  -1,             7,         - e - 1]

c =

-2

A =

[ 1,           1/(e - 1),    -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4, 5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,                   1,         1 - e,              11]
[ 2,                  -1,             7,         - e - 1]

A =

[ 1,           1/(e - 1),    -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4, 5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1),         1 - e,              11]
[ 2,                  -1,             7,         - e - 1]

A =

[ 1,           1/(e - 1),        -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,              11]
[ 2,                  -1,                 7,         - e - 1]

A =

[ 1,           1/(e - 1),        -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,  11 - 8/(e - 1)]
[ 2,                  -1,                 7,         - e - 1]

c =

-2

A =

[ 1,           1/(e - 1),        -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,  11 - 8/(e - 1)]
[ 0,                  -1,                 7,         - e - 1]

A =

[ 1,           1/(e - 1),        -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,  11 - 8/(e - 1)]
[ 0,     - 2/(e - 1) - 1,                 7,         - e - 1]

A =

[ 1,           1/(e - 1),        -1/(e - 1),       4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3, 12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,  11 - 8/(e - 1)]
[ 0,     - 2/(e - 1) - 1,     2/(e - 1) + 7,         - e - 1]

A =

[ 1,           1/(e - 1),        -1/(e - 1),           4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3,     12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,      11 - 8/(e - 1)]
[ 0,     - 2/(e - 1) - 1,     2/(e - 1) + 7, - e - 8/(e - 1) - 1]

a =

- e - 5/(e - 1) - 4

Adet =

(e - 1)*(e + 5/(e - 1) + 4)

A =

[ 1,           1/(e - 1),        -1/(e - 1),           4/(e - 1)]
[ 0, - e - 5/(e - 1) - 4,     5/(e - 1) + 3,     12 - 20/(e - 1)]
[ 0,       1 - 2/(e - 1), 2/(e - 1) - e + 1,      11 - 8/(e - 1)]
[ 0,     - 2/(e - 1) - 1,     2/(e - 1) + 7, - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),        -1/(e - 1),           4/(e - 1)]
[ 0,               1,     5/(e - 1) + 3,     12 - 20/(e - 1)]
[ 0,   1 - 2/(e - 1), 2/(e - 1) - e + 1,      11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,     2/(e - 1) + 7, - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),                           -1/(e - 1),           4/(e - 1)]
[ 0,               1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),     12 - 20/(e - 1)]
[ 0,   1 - 2/(e - 1),                    2/(e - 1) - e + 1,      11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,                        2/(e - 1) + 7, - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),                           -1/(e - 1),                             4/(e - 1)]
[ 0,               1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4), (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,   1 - 2/(e - 1),                    2/(e - 1) - e + 1,                        11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,                        2/(e - 1) + 7,                   - e - 8/(e - 1) - 1]

c =

2/(e - 1) - 1

A =

[ 1,       1/(e - 1),                           -1/(e - 1),                             4/(e - 1)]
[ 0,               1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4), (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,   1 - 2/(e - 1),                    2/(e - 1) - e + 1,                        11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,                        2/(e - 1) + 7,                   - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),                           -1/(e - 1),                             4/(e - 1)]
[ 0,               1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4), (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,               0,                    2/(e - 1) - e + 1,                        11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,                        2/(e - 1) + 7,                   - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),                                                                -1/(e - 1),                             4/(e - 1)]
[ 0,               1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4), (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,               0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1,                        11 - 8/(e - 1)]
[ 0, - 2/(e - 1) - 1,                                                             2/(e - 1) + 7,                   - e - 8/(e - 1) - 1]

A =

[ 1,       1/(e - 1),                                                                -1/(e - 1),                                                                4/(e - 1)]
[ 0,               1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                    (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,               0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1, ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0, - 2/(e - 1) - 1,                                                             2/(e - 1) + 7,                                                      - e - 8/(e - 1) - 1]

c =

2/(e - 1) + 1

A =

[ 1,       1/(e - 1),                                                                -1/(e - 1),                                                                4/(e - 1)]
[ 0,               1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                    (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,               0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1, ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0, - 2/(e - 1) - 1,                                                             2/(e - 1) + 7,                                                      - e - 8/(e - 1) - 1]

A =

[ 1, 1/(e - 1),                                                                -1/(e - 1),                                                                4/(e - 1)]
[ 0,         1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                    (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1, ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0,                                                             2/(e - 1) + 7,                                                      - e - 8/(e - 1) - 1]

A =

[ 1, 1/(e - 1),                                                                -1/(e - 1),                                                                4/(e - 1)]
[ 0,         1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                    (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1, ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0,     2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7,                                                      - e - 8/(e - 1) - 1]

A =

[ 1, 1/(e - 1),                                                                -1/(e - 1),                                                                   4/(e - 1)]
[ 0,         1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                       (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1,    ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0,     2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7, ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

a =

2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1

Adet =

-(e - 1)*(e + 5/(e - 1) + 4)*(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)

A =

[ 1, 1/(e - 1),                                                                -1/(e - 1),                                                                   4/(e - 1)]
[ 0,         1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                       (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1,    ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0,     2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7, ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                                                                -1/(e - 1),                                                                   4/(e - 1)]
[ 0,         1,                                      -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                       (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0, 2/(e - 1) - e - ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 1,    ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0,     2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7, ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                                                            -1/(e - 1),                                                                   4/(e - 1)]
[ 0,         1,                                  -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                       (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                                                     1,    ((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11]
[ 0,         0, 2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7, ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                                                            -1/(e - 1),                                                                                                                                               4/(e - 1)]
[ 0,         1,                                  -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                   (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                                                     1, -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0, 2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7,                                                                             ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

c =

((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 2/(e - 1) - 7

A =

[ 1, 1/(e - 1),                                                            -1/(e - 1),                                                                                                                                               4/(e - 1)]
[ 0,         1,                                  -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                   (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                                                     1, -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0, 2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7,                                                                             ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                                                            -1/(e - 1),                                                                                                                                               4/(e - 1)]
[ 0,         1,                                  -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                   (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                                                     1, -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0, 2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7,                                                                             ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                               4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                   (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1, -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0,                                                                             ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) - e - 1]

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                                                                                                                                                                                      4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                                                                                                                                                                          (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1,                                                                                                                                                        -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0, ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - 8/(e - 1) - e + ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 1]

a =

((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - 8/(e - 1) - e + ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 1

Adet =

(e - 1)*(e + 5/(e - 1) + 4)*(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)*(e + 8/(e - 1) - ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) + 1)

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                                                                                                                                                                                      4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                                                                                                                                                                          (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1,                                                                                                                                                        -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0, ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - 8/(e - 1) - e + ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 1]

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                                                                                                                                                                                      4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                                                                                                                                                                          (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1,                                                                                                                                                        -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0, ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - 8/(e - 1) - e + ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 1]

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                                                                                                                                                                                      4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                                                                                                                                                                          (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1,                                                                                                                                                        -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0, ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - 8/(e - 1) - e + ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 1]

A =

[ 1, 1/(e - 1),                           -1/(e - 1),                                                                                                                                               4/(e - 1)]
[ 0,         1, -(5/(e - 1) + 3)/(e + 5/(e - 1) + 4),                                                                                                                   (20/(e - 1) - 12)/(e + 5/(e - 1) + 4)]
[ 0,         0,                                    1, -(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11)/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)]
[ 0,         0,                                    0,                                                                                                                                                       1]

Adet =

(e - 1)*(e + 5/(e - 1) + 4)*(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1)*(e + 8/(e - 1) - ((2/(e - 1) - ((2/(e - 1) + 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) + 7)*(((2/(e - 1) - 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) - 8/(e - 1) + 11))/(e - 2/(e - 1) + ((2/(e - 1) - 1)*(5/(e - 1) + 3))/(e + 5/(e - 1) + 4) - 1) - ((2/(e - 1) + 1)*(20/(e - 1) - 12))/(e + 5/(e - 1) + 4) + 1)

Adet =

 RootOf(z^4 + 3*z^3 - 62*z^2 - 256*z + 414, z)[1]
 RootOf(z^4 + 3*z^3 - 62*z^2 - 256*z + 414, z)[2]
 RootOf(z^4 + 3*z^3 - 62*z^2 - 256*z + 414, z)[3]
 RootOf(z^4 + 3*z^3 - 62*z^2 - 256*z + 414, z)[4]

Adet =

   1.2639 + 0.0000i
   7.9781 + 0.0000i
  -6.1210 + 1.8947i
  -6.1210 - 1.8947i

  

时间: 2024-11-08 23:23:35

高斯消元法求特征值的相关文章

[程序设计入门—C语言] 数字求特征值

题目是网易云课堂浙大C语言的练习题 题目内容: 对数字求特征值是常用的编码算法,奇偶特征是一种简单的特征值.对于一个整数,从个位开始对每一位数字编号,个位是1号,十位是2号,以此类推.这个整数在第n位上的数字记作x,如果x和n的奇偶性相同,则记下一个1,否则记下一个0.按照整数的顺序把对应位的表示奇偶性的0和1都记录下来,就形成了一个二进制数字.比如,对于342315,这个二进制数字就是001101. 按照二进制位值将1的位的位值加起来就得到了结果13. 你的程序要读入一个非负整数,整数的范围是

C++调用Matlab函数求特征值

最近需要用到C++和Matlab的混编,记录一下学习过程~ 要实现的是调用Matlab函数,求矩阵前k个最小的特征值及其特征向量. //C++ #include "engine.h" //使用Matlab引擎需要包含的头文件#include <iostream>using namespace std;int main(){ Engine *m_engine; //创建Matlab引擎 m_engine = NULL; //初始化引擎 if((!m_engine &&

幂迭代法求特征值和特征向量

幂迭代法求第k大的特征值和特征向量 数学表述 设矩阵A \[ A = \left[ \begin{matrix} X_{11}&\ldots&X_{1n} \newline X_{21} & \ldots& X_{2n} \newline &\vdots& \newline X_{n1}&\ldots &X_{nn} \newline \end{matrix} \right] \] 求其最大特征值对应的特征向量\(b_k = [v_1,v_2

高斯消元法求逆矩阵

A=[1,-1,1,-4;5,-4,3,12;2,1,1,11;2,-1,7,-1] E=[1,0,0,0;0,1,0,0;0,0,1,0;0,0,0,1] b=[2,4,3,0]' %开始消元过程 for k=1:(length(A)) a=A(k,k) for i=1:(length(A)) A(k,i)=A(k,i)/a E(k,i)=E(k, i)/a end b(k,1)=b(k,1)/ a for i=k+1:(length(A)) c=-A(i,k) for j=1: (lengt

高斯消元法求矩阵的行列式

A=[1,-1,1,-4;5,-4,3,12;2,1,1,11;2,-1,7,-1] Adet=1 %开始消元过程 for k=1:(length(A)) a=A(k,k) Adet = Adet.*a for i=1:(length(A)) A(k,i)=A(k,i)/a end for i=k+1:(length(A)) c=-A(i,k) for j=1: (length(A)) A(i,j)=A(i,j)+c.*A(k,j) end end end Adet A = 1 -1 1 -4

HDU 4418 高斯消元法求概率DP

把两种状态化成2*n-2的一条线上的一种状态即可.很容易想到. 高斯列主元法,不知为什么WA.要上课了,不玩了...逃了一次课呢.. #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <cmath> using namespace std; double const eps=1e-8; double G[210][210];

高斯消元法求齐次线性方程的通解

2个方程,2个约束,4个未知量,2个自由未知量 每个台阶首非零元,取为约束未知量 原文地址:https://www.cnblogs.com/YC-L/p/12243711.html

矩阵的特征向量和特征值

[1. 特征的数学意义]        我们先考察一种线性变化,例如x,y坐标系的椭圆方程可以写为x^2/a^2+y^2/b^2=1,那么坐标系关于原点做旋转以后,椭圆方程就要发生变换.我们可以把原坐标系的(x,y)乘以一个矩阵,得到一个新的(x',y')的表示形式,写为算子的形式就是(x,y)*M=(x',y').这里的矩阵M代表一种线性变换:拉伸,平移,旋转.那么,有没有什么样的线性变换b(b是一个向量),使得变换后的结果,看起来和让(x,y)*b像是一个数b乘以了一个数字m*b? 换句话说

利用QR算法求解矩阵的特征值和特征向量

利用QR算法求解矩阵的特征值和特征向量 为了求解一般矩阵(不是那种幼稚到shi的2 x 2矩阵)的特征值. 根据定义的话,很可能需要求解高阶方程... 这明显是个坑...高阶方程你肿么破... 折腾了好久 1.我要求特征值和特征向量. 2.找到一种算法QR分解矩阵求解特征值 3.QR矩阵分解需要Gram-schimidt正交化分解 有一种很明显的感觉,往往在现在很难有 很系统 很深入 的学习某一个学科的某一门知识. 往往学的时候"靠,学这东西有什么用""学了这么久,也不知道怎么用,不想学" 到后