How can i correct this error ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Mallouli Marwa
am 1 Sep. 2016
Kommentiert: Star Strider
am 1 Sep. 2016
Hi
In my program, i use the function eig to return the eigenvalues :
[V,D]=eig(k,m);
But i have obtained this error:
Error using eig
EIG does not support generalized eigenproblem EIG(A,B) when A or B is sparse.
Please help me.
2 Kommentare
Adam
am 1 Sep. 2016
Clearly you need to give us more information on k and m. Judging from the error messages though it seems clear that one of your two inputs, k or m, are sparse matrices and these are not supported by Eig.
Akzeptierte Antwort
Star Strider
am 1 Sep. 2016
According to the sparse matrix section of the documentation, you need to use the eigs function.
2 Kommentare
Star Strider
am 1 Sep. 2016
They seem to, but the results of eig are ordered opposite those of eigs. The eigs funciton works with sparse matrices, while eig does not.
Check them with something like this example (not using sparse matrix arguments):
A = randi([-9 9], 5);
[V1,D1] = eig(A)
[V2,D2] = eigs(A)
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Algebra finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!