echo on

% enter matrix
%


A=[5 2 -2; 2 5 -2 ; -2 -2 5]

pause

% compute coefficients of the 
% characteristic polynomial
%

p=poly(A)

pause

% compute roots
%

roots(p)

pause

% subtract e-value 3
%

I=eye(3)

B=A-3*I

rref(B)

pause

% compute other eigenvector
%

C=rref(A-9*I)
