Path: news.mathworks.com!not-for-mail
From: "Steven_Lord" <slord@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: help on eigen values
Date: Wed, 11 May 2011 09:41:20 -0400
Organization: MathWorks
Lines: 70
Message-ID: <iqe3m0$f0e$1@newscl01ah.mathworks.com>
References: <iqcevu$mqk$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: ah-slord.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="UTF-8";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: newscl01ah.mathworks.com 1305121280 15374 172.31.44.225 (11 May 2011 13:41:20 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 11 May 2011 13:41:20 +0000 (UTC)
In-Reply-To: <iqcevu$mqk$1@newscl01ah.mathworks.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8089.726
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8089.726
Xref: news.mathworks.com comp.soft-sys.matlab:726217



"meena rao" <meenaraos@yahoo.co.in> wrote in message 
news:iqcevu$mqk$1@newscl01ah.mathworks.com...
> Hi
>
> I have a 7X7 matrix (temp) with the following values.
>
> 2.0082 0.79279 1.8691 1.7958 -1.0791 10.31 7.785
> 0.87496 0.72739 0.85899 0.83214 0.53583 1.7803 1.9835
> -4.2761 -3.6621 -4.2281 -4.0781 -2.926 -7.8672 -9.4534
> 4.8772 2.6568 4.6296 4.4343 -0.69886 19.897 18.487
> -4.723 -0.65076 -4.2237 -3.9354 5.7739 -33.167 -34.238
> 4.1391 -7.9086 2.5553 1.9767 -27.555 90.26 92.619
> 1.4833 -15.29 -0.77169 -1.493 -42.927 122.31 128.62
>
> I need to find the eigen values of this matrix and i have used the code,
>
> lamda1= eig(temp)
> finalmean=mean(lamda1)
>
> Now the values displayed on the command prompt is,
>
> 228.4188
> -4.6455
> 3.8133
> 0.0084
> 0.0041
> 0
> 0
>  and the values in the workspace of lamda1 is,
>
> 228.42
> -4.6455
> 3.8133
> 0.0083723
> 0.0040799
> 5.53E-09
> -5.99E-08
>
> Is the value in the workspace of lamda1 is right. And i am calling the 
> right function to get the eigen values of a matrix.

EIG is one of the correct functions to compute the eigenvalues of a matrix; 
for the type of matrix you have, it is the one I recommend you use.

To confirm that lamda1 (BTW if you were looking to spell the Greek character 
it's lambda1 not lamda1) is the vector of eigenvalues, call EIG with two 
outputs:

[eigenvectors, eigenvalues] = eig(temp);

Now you know that an eigenvalue lambda and its corresponding eigenvector V 
must satisfy the following equation:

temp*V = lambda*V

So check this.

result = temp*eigenvectors-eigenvalues*eigenvectors

All the elements of this result should be "small" -- if so you have 
eigenvalues and eigenvectors.

-- 
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com