Hi, I am running a loop for a multi regression. Could you please guide how i could store stats for each variable rather than overwriting it?
I have 6 dependable variables and one independent which loop 500 times.
Thank you.

 Réponse acceptée

Kilo - does this mean that you want to store six dependent (?) and one independent variable values for 500 iterations? If so, then just create an array as
myStats = zeros(7,500);
and then on each iteration of your loop, update the myStats column for the appropriate iteration. For example,
myStats = zeros(7,500);
for k=1:500
% do something
% save stats
myStatus(1,k) = ...;
myStatus(2,k) = ...;
% etc.
end

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by