Pergunta

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)

Foi útil?

Solução

Yes, use eigs to return the K largest or smallest eigenvalues.

Example: eigs(A,[],K) will return the K largest-magnitude eigenvectors of matrix A.

Outras dicas

You are looking for eigs. From help eigs:

Find a few eigenvalues and eigenvectors of a matrix

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top