Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A=[0.05,0.85,0.05,0.25;0.45,0.05,0.45,0.25;0.45,0.05,0.05,0.25;0.05,0.05,0.45,0.25]
- v=rand(4,1) //initial guess vector
- for k = 1:20
- w=A*v;
- lambda=v'*w;
- v=w/norm(w);
- end
- v
- z=poly(0,'z');
- p=det(z*eye(4,4)-A);
- roots(p)'
- lambdaI=zeros(4,4);
- for k = 1:4
- lambdaI(k,k)=v(k);
- end
- lambdaI
- det(lambdaI-A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement