-2

I want find in matlab ,the smallest negative eigen value,from complex eigenvalues ,of a squaure matrix (5,5) with all the entries of the matrix are complex .The answer should be real value.So how can I do this im matlab?.

user1079331
  • 11
  • 1
  • 1
  • 6
  • What makes you think there will be real valued eigenvalues? – David Heffernan Dec 03 '11 at 22:54
  • the eigenvalues are complex, but when I choose in matlab the smallest one from the complex eigenvalues ,the answer is positive real because I use min(abs(eigenvalues)).And I the answer should be negative,because I need to use the negative of this value. – user1079331 Dec 04 '11 at 12:23
  • You still have not defined precisely what you want. Complex numbers are not totally ordered so there is no min or max. – David Heffernan Dec 04 '11 at 12:35
  • Here you hit the point ,how can I compare complex numbers to find the smallest negative one? – user1079331 Dec 04 '11 at 13:23
  • There's no such thing as a negative complex number. – David Heffernan Dec 04 '11 at 13:39
  • I have negative complex eigenvalues. – user1079331 Dec 04 '11 at 14:19
  • 1
    No you do not. There is no such thing as a negative complex number. You can have negative real numbers. If you have 0 imaginary part then you have a real number which can be positive or negative. – David Heffernan Dec 04 '11 at 14:44
  • `min(abs(eigenvalues))` does not give the smallest eigenvalue; it gives you the eigenvalue closest to the origin of the complex plane. You need to make clear what you mean by "smallest". – Kavka Dec 05 '11 at 17:30

2 Answers2

0

You cannot compare complex numbers. At most, you can compare the magnitudes of complex numbers.So, min(abs(eig(A))) is the right answer. If you need the negative of this value, just tack on a negative sign

Rohit
  • 1,967
  • 1
  • 12
  • 15
0

Is it what you need?

min(real(eig(A)));
Oli
  • 15,935
  • 7
  • 50
  • 66