%% Eigenvalues of Matrix
% Use gallery to create a symmetric positive definite matrix.

A = gallery('lehmer',4)

%
% Calculate the eigenvalues of A. The result is a column vector.

e = eig(A)

%
% Alternatively, use eigvalOption to return the eigenvalues in a diagonal matrix.

D = eig(A,'matrix')

% Copyright 2012 The MathWorks, Inc.