Sample m,v=eig(B) return m,v where m and v are from smalest do bigest
value. First eigen value and eigenvec are on the last position
You must flip/flop both:
v=fliplr(v);m=flipud(m)
julia> A=rand(4,4)
4x4 Array{Float64,2}:
0.661782 0.366042 0.149729 0.445334
0.658829 0.376393 0.0998171 0.637071
0.851418 0.876499 0.74864 0.544398
0.0921396 0.522684 0.384848 0.853703
julia> B=cor(A)
4x4 Array{Float64,2}:
1.0 0.308153 0.18808 -0.858457
0.308153 1.0 0.988595 -0.0151858
0.18808 0.988595 1.0 0.0563374
-0.858457 -0.0151858 0.0563374 1.0
julia> m,v=eig(B)
([4.44089e-16,0.109119,1.70604,2.18484],
4x4 Array{Float64,2}:
0.207923 0.6822 0.509621 -0.481308
-0.712208 0.0744095 -0.368759 -0.592655
0.65762 -0.269323 -0.432141 -0.555208
0.130629 0.675671 -0.646187 0.32992 )
julia> m
4-element Array{Float64,1}:
4.44089e-16
0.109119
1.70604
2.18484
W dniu 2015-08-23 o 22:45, Edward Chen pisze:
Would there be any reason to suspect that the ordering of the
eigenvalues and the eigenvectors are different? I am doing a
side-by-side comparison with the eig function in MATLAB and it seems
to give a different ordering of vectors for the same matrix.
On Saturday, April 26, 2014 at 5:15:21 PM UTC-4, Ethan Anderes wrote:
Paul:
Sorry, I don't think I can help you there. I don't have any
observational errors, just numerical error in the matrix.