matrixeigenexample

matrixeigenexample - Example of a Symmetric Matrix with...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Page 1 of 3 1/28/2008 matrixeigenexample.doc >> A=[ 5 4 1 1; 4 5 1 1;1 1 4 2;1 1 2 4] A = 5 4 1 1 4 5 1 1 1 1 4 2 1 1 2 4 >> [X,LAM]=eig(A) X = 0.7071 -0.0000 0.3162 0.6325 -0.7071 -0.0000 0.3162 0.6325 0.0000 0.7071 -0.6325 0.3162 -0.0000 -0.7071 -0.6325 0.3162 LAM = 1.0000 0 0 0 0 2.0000 0 0 0 0 5.0000 0 0 0 0 10.0000 >> X'*X ans = 1.0000 0.0000 -0.0000 -0.0000 0.0000 1.0000 -0.0000 0 -0.0000 -0.0000 1.0000 0.0000 -0.0000 0 0.0000 1.0000 >> X*LAM*X' ans = 5.0000 4.0000 1.0000 1.0000 4.0000 5.0000 1.0000 1.0000 1.0000 1.0000 4.0000 2.0000 1.0000 1.0000 2.0000 4.0000 >> A*X-X*LAM ans = 1.0e-014 * 0 -0.0236 -0.1110 0.0888 -0.0555 -0.0340 -0.1776 0.0888 0.0382 0.0888 -0.0888 0.2220 0.0075 0.1110 0.0444 0.1776 Set up this 4 by 4 symmetric matrix Use the Matlab eig function to compute the X matrix and the LAM matrix. The columns of X are the eigenvectors. The diagonals of LAM are the corresponding eigenvalues. The X matrix is orthogonal: i.e. its transpose is its inverse. The matrix can be represented as A = X*LAM*X’ Note that A*X = X*LAM since A*X- X*LAM is zero with the numerical tolerance of Matlab. It is easy to show that the
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

matrixeigenexample - Example of a Symmetric Matrix with...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online