Assignment inside While[ ]?

Hi, I need to plot the eigenvalues calculated by the function Eigenvalue.
so: during a while loop I build a matrix, I evaluate the eigenvalues and I need store them in a vector.
but I can’t use %[1] for assign the value obtained in the vector that I will use for plot. How can I solve?

Hi Marco,

Avoid using %, assign the result to a symbol and use it.

While[Va < 1.8, 
Stato = Inverse[Ma] . ((-Ω^2*Ka) - (Va^2*Fexta));
eigenValues = Eigenvalues[Stato];
a2 = eigenValues[[1]];
b2 = eigenValues[[2]];
Print[a2];
λ[i] = {a2, b2};
i = i + 1;
Va = Va + 0.01;]