%% Characteristic Polynomial from Eigenvalues
% Calculate the eigenvalues of a matrix, A.

A = [1 8 -10; -4 2 4; -5 2 8]

%

e = eig(A)

%
% Since the eigenvalues in e are the roots of the characteristic polynomial of A, use poly to determine the characteristic polynomial from the values in e.

p = poly(e)

% Copyright 2015 The MathWorks, Inc.