Conflicting eigen vector outputs between Matlab and Numpy

北城余情 提交于 2019-12-01 16:06:44

It's not immediately obvious, but the eigenvectors you are being returned are actually the same in both cases. Try the following:

>>> matlab_eigvec = np.array([[0.0896+0.6789j, 0.0953+0.7225j],
...                           [-0.7288+0.j, 0.6848+0.j]])
>>> 
>>> f1, f2 = matlab_eigvec.T # matlab eigenvectors
>>> e1, e2 = eig_vec.T # numpy eigenvectors
>>> f1/e1
array([-0.13084653-0.99142531j, -0.13079065-0.99146862j])
>>> f2/e2
array([-0.13077050-0.99141326j, -0.13078845-0.99145198j])

So you can get the matlab eigenvectors by multiplying the numpy ones by -0.13-0.99j, i.e. they are colinear and therefore the same as far as eigenvectors are concerned.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!