summaryrefslogtreecommitdiff
path: root/260/CH5/EX5.1/5_1.sce
blob: 90d9b5ce68e63d0d5a89d8b13cc271dc965c608a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//Eg-5.1
//pg-213

clear
clc

A=[1 -1 4;3 2 -1;2 1 -1];
d=spec(A);

//eigen equation

printf('the eigen equation is(L-%f)(L-(%f))(L-%f)=0',d(1),d(2),d(3));

//eigen values

disp(d)

//Verification

e=diag(A);
f=det(A);

if sum(e)==sum(d)&prod(d)==f then
    disp("verification done")
end

//Eigen Vectors

[v,d]=spec(A);

disp("eigen vectors corresponding to each eigenvalue are  are columns of the following matrix")
disp(v)

printf('\n\nThe eigen vectors are different because each set of equations have infinite solutions and the ones given in the text book are just one of them.\n')