MATLAB: Storing a value as a vector

eigenvaluesiterationsstoring values

Hello,
I am running an iteration which helps find the eigenvalues of a matrix. I want to store the eigenvalues in each iteration so that I can analyze them later. What should I use ? I don't know why
B(:,:) = eig(A)
doesn't work. There are four eigenvalues expected in one matrix.

Best Answer

for ii = 1:N
B(:,n) = eig(A);
end