From: Kongbin Kang <kk@le...>  20050510 20:04:48

Amitha Perera wrote: >On Tue 10 May 2005, maziyar wrote: > > >>I have tried using: >> >>vnl_symmetric_eigensystem<double> eig(cov(data.transpose())); >>vcl_cerr << eig.V << vcl_endl; >>vcl_cerr << eig.D << vcl_endl; >> >>to find the eigenvalues and the eigenvectors for a covariance matrix. When >>comparing my results to those of Matlab, I am producing similiar eigenvalues, >>however, my eigenvectors are not the same. >> >>Is this an expected result due to the different algorithms used by the two >>systems, or should they yield the same result. >> >> > > > If the matrix is nonedegenerate, the eigenvectors of the matrix should be unique upto a scale. It means matlab or vxl should be different only up to the machine accuracy. But for degenerate matrix, the solution to eigenvector is not unique so that it is normal to have different eigenvectors. If you can post the eigen values, eigenvectors and your matrix, we may find out whether it is normal or not to have difference between vxl and matlab. 