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?.
Asked
Active
Viewed 1,943 times
-2
-
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
-
1No 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 Answers
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
-
No,because this is wrong to select only the real part of the complex number. – user1079331 Dec 04 '11 at 12:13
-
2In that case, What do you mean by "smallest negative eigenvalue" and "the answer should be real value:? – Oli Dec 04 '11 at 12:23
-
How can I compare complex numbers to find the smallest negative one? – user1079331 Dec 04 '11 at 13:24
-
Do you mean that you want to find the complex number which has the smallest real part? For instance if you have [-5+4i, -2+3i, 10-12i] you want -5+4i – Oli Dec 04 '11 at 15:11
-
-
This is more a math question than a programing question... You can compare their real part, or the modulus... – Oli Dec 06 '11 at 16:43