I would like to solve an eigenvalue problem for a PDE by a finite difference method. Therefore my problem is reduced to a matrix eigenvalue problem. The thing is that the size of this matrix will be quite large, and if I use the function eig it searches for ALL the eigenvalues and eigenvectors, which in my case is a waste of time.
Is there a possibility to make the eigenvalue algorithm stop after finding the first k eigenvalues? (where k is a small positive integer)
Yes, use
eigsto return the K largest or smallest eigenvalues.Example:
eigs(A,[],K)will return theKlargest-magnitude eigenvectors of matrixA.