Different results in different computers when using the function "eig" to obtain eigenvectors of a matrix
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Zhe Zhang
il 24 Nov 2015
Risposto: Titus Edelhofer
il 24 Nov 2015
The version of matlab in my computer is R2014a, and my friend's version is the same with mine. But when we run the same program, we get different results. We found that the function "eig" produced different results in both computers. The eigenvalues are the same but in different orders. What's more, the corresponding eigenvector of the same eigenvalue is not the same. The attachment includes 3 matrixes. The "D1" is the matrix what we want to get eigenvalues and eigenvectors from. The "D" is the matrix of eigenvalues what we obtain in decreasing order. The "B" is the matrix of eigenvectors corresponding to the eigenvalues. The data of attachment is obtained from my computer. As I said before ,my results are different from results in my friend's computer. So, I want to ask that the data of the attachment is right or wrong? Thanks ! :)
0 Commenti
Risposta accettata
Titus Edelhofer
il 24 Nov 2015
Hi Zhe,
keep in mind, that eig quite often sorts the eigenvalues but it does not promise to do so. So having a different ordering is fine. Also keep in mind, that eigenvectors are not unique: they are subject to scaling.
To test, if everything goes fine, is to test, if the result is correct. From the doc:
[V,D] = eig(A) returns matrix V, whose columns are the right eigenvectors of A such that A*V = V*D.
So give it a try, of course you will need to test A*V-V*D being "small".
Titus
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!