I'm trying to create an algorithm in MATLAB, but I have a problem. According to theory, if G is a positive definite matrix, then it's eigenvalues are positive real numbers. I'm using function EIG() to calculate the eigenvalues and eigenvectors of matrices, but I almost always take and negative numbers as eigenvalues.(adsbygoogle = window.adsbygoogle || []).push({});

F.e.

a =

1 2 3

2 1 2 → Eigenvalues taken: -2.0000, -0.7016, 5.7016

3 2 1

---

a =

0 1 2

1 0 1 → Eigenvalues taken: -2.0000, -0.7321, 2.7321

2 1 0

---

My Questions:

1) How can I test is a matrix is positive definite matrix, without having to test the equation z*Az>0 for every z? (- that's impossible to test in that way, for every possible z!!).

2) Are the above example matrices Positive Definite? And if not why?

3) Can anyone provide me with 3x3, 4x4 or 5x5 at least Positive Definite matrices? ..

4) If the example matrices I gave, are positive definite, then why EIG() is giving me negative eigenvalues? I use it as [V,D]=eig(a) (-the eigenvalues are at the diagonal of D).

5) And, are the eigenvalues I show here, correct for these two example matrices?....!...

That's my questions. If anyone can help.. Thanks :)

Ps. I'm not mathematician, so please, if you can, don't mess me with with "high-complexibilty" mathematics/theories.

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Eigenvalues of Positive Definite matrices - &MATLAB

**Physics Forums | Science Articles, Homework Help, Discussion**