Eigs passes the wrong StartVector
显示 更早的评论
Hi all,
I'm using MATLAB 2019b 64-bits. I'm calling eigs() to find the largest eigenvector of a matrix by passing it a function handle and specifying a 'StartVector' as follows:
A = reshape(1:9,3,3); % create some matrix for testing
StartVector = [0.4 0.9 1.7]'; % specify a start vector for eigs()
[vec,ev] = eigs(@(vec)test_eigs(vec,A),3,1,'largestabs','Display',0,'IsFunctionSymmetric',0,'MaxIterations',300,'StartVector',StartVector);
The definition of test_eigs() is as follows:
function vec = test_eigs(vec,A)
vec = A*vec;
end
However, eigs does not pass the specified start vector to the first call of test_eigs(). Instead, it passes the vector [1 0 0]' on all runs of the program. What am I missing? I'd appreciate any pointers!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!