Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
help on eigen values

Subject: help on eigen values

From: meena rao

Date: 10 May, 2011 22:42:06

Message: 1 of 5

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.

Thanks and regards

meena.

Subject: help on eigen values

From: John D'Errico

Date: 10 May, 2011 22:48:04

Message: 2 of 5

"meena rao" <meenaraos@yahoo.co.in> wrote in message <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.
>
> Thanks and regards
>
> meena.

help format

Subject: help on eigen values

From: Steven_Lord

Date: 11 May, 2011 13:41:20

Message: 3 of 5



"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

Subject: help on eigen values

From: Roger Stafford

Date: 11 May, 2011 15:34:05

Message: 4 of 5

"meena rao" <meenaraos@yahoo.co.in> wrote in message <iqcevu$mqk$1@newscl01ah.mathworks.com>...
> ......
> Is the value in the workspace of lamda1 is right. .....
> ......
- - - - - - - - -
  Meena, it is very important for Matlab users to understand the difference between the actual binary floating point value of a quantity stored within memory and a displayed approximate decimal representation of that quantity. The stored value is what is actually used in computation, while the displayed value is only an approximate indication of its value for the user's benefit.

  As John has indicated, the accuracy of such displays is controlled by the 'format' setting. The default "format short" gives four digits after the decimal point while "format long" for example gives about 14 places after the decimal point (for 'double' numbers.) The only one of the 'format' settings that is guaranteed to give the precise value is "format hex", but unfortunately that is difficult to interpret for persons accustomed to decimal numbers.

  Here's an example using the quantity 'pi'. With the default "format short" it is displayed as "3.1416", with "format long" it is shown as "3.14159265358979", and with "format hex" it appears as a rather mysterious "400921fb54442d18". Only this last is a precise representation of the true stored value. If this were given as a binary fraction it would be the mind-boggling 53-bit number:

 1.1001001000011111101101010100010001000010110100011000

and this is what actually would be used in computation with 'pi'. This should show you why more compact representations are desirable for display purposes.

  (Of course, since the true mathematical pi is a transcendental number, even the above binary number is only an approximation accurate to 53 bits - the best that double precision floating point can do.)

Roger Stafford

Subject: help on eigen values

From: Greg von Winckel

Date: 12 May, 2011 09:15:19

Message: 5 of 5

> I need to find the eigen values of this matrix and i have used the code,
>
> lamda1= eig(temp)
> finalmean=mean(lamda1)
>

I don't know what your application is, but I see you compute the mean of the eigenvalues. If you only needed this value for whatever reason and not the individual eigenvalues, you could obtain it more quickly with trace(A)/size(A,1)

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us