Hello octave users
I have what I hope is a simple problem
I have a square matrix, A, currently 10by10, may at later time have different dimensions.
asking for eigenvalues and eigen vectors
[vect, val] =eig(A);
I need the dominant eigenvalue and corresponding eigenvector
When the matrix was 3by3 I did the following, which I find tedious
if (max(max(val)) == val(1,1))
V = vect(1:3,1);
elseif (max(max(val)) == val(2,2));
V = vect(1:3,2);
else
V = vect(1:3,3);
endif
the dominant eigen value was similarily extracted by
ld=max(max(val))
My question is, as you may have guessed by now, is there any simpler way to get a eigenvector that mathces the dominant eigenvalue? I am thinking to somehow getting the postion where the dominant eigenvalue is and locate the eigenvector based on the position.
In my application the dominant eigenvalue is allways positive.
Thanks,
Stefan