Eigs passes the wrong StartVector
Show older comments
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!
Accepted Answer
More Answers (0)
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!