%
% s04poly.m - Compute a characteristic polynomial and its roots
%
format short;
A=[-5, 2, 1; 2, -5, 2; 1, 2, 4]
P=poly(A)
X1=roots(P); X=sort(X1)
Y1=eig(A);   Y=sort(Y1)
d=norm(X-Y,2)