How can I find all the eigenvectors of a very large, sparse, symmetric, positive-definite matrix in MATLAB 7.8 (R2009a) ?

2 views (last 30 days)
I am trying to get all the eigenvectors and eigenvalues for a very large (22500x22500) sparse, symmetric, positive-definite real matrix A.
I am able to get all the eigenvalues of this matrix using the function EIG. However when I try to find the eigenvectors using EIGS, I run into out of memory problems.
[V D] = eigs(A, 22000);

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Aug 2009
You are receiving the out of memory error because EIGS tries to return all of the eigenvectors at once and it is not possible to store all the 22500 eigenvectors on a 32-bit machine.
As a workaround, knowledge of the eigenvalues can be used to access the eigenvectors in chunks using the function EIGS as follows:
[V D] = eigs(A,100,0);
The above code will give 100 eigenvectors corresponding to eigenvalues closest to 0. For better results, never use an eigenvalue as the shift (third argument in EIGS).
When retreiving the eirgenvectors, note that although the matrix is sparse the eigenvectors are most likely dense.

More Answers (0)


Find more on Linear Algebra in Help Center and File Exchange


No tags entered yet.




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!