From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Eigenvalues and Matlab
Date: Tue, 20 Apr 2010 00:08:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 33
Message-ID: <hqir93$gru$>
References: <hqipl7$k82$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1271722083 17278 (20 Apr 2010 00:08:03 GMT)
NNTP-Posting-Date: Tue, 20 Apr 2010 00:08:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:628006

"Mark Roman" <> wrote in message <hqipl7$k82$>...
> Hey All
> I've been assigned some work to do by hand and by matlab.  I figure matlab is performing the calculations correctly, but I can't seem to produce the output I would expect.  As a disclaimer, I typically only use matlab in coursework, so I'm not proficient.
> I'm working with the matrix 
> A=[1i,1;1,-1i]
> and I'm looking for the eigenvalues.
> I would expect the only value to be 0.
> Matlab produces...
> lambda=eig(A)
> lambda =
>    1.0e-15 *
>    0.0647 + 0.0079i
>   -0.3174 - 0.1406i
> It would be a great help if someone could explain why I'm reaching this result.
> Thanks!
> Mark

  There's nothing wrong with your work by hand.  The precise values of those eigenvalues are both zero.  However, you are witnessing the effects of round off error here with the output of 'eig'.  Note the size of those eigenvalue results.  They are down in the range of single bit errors in the least bit position of the original values in A.  This is something you will have to become accustomed to in numerical computation by machines with only a finite number of bits of accuracy - in this case 53.

Roger Stafford