Storing multi regression variables for each loop

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.

 Respuesta aceptada

Geoff Hayes
Geoff Hayes el 20 de Oct. de 2017
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

Más respuestas (0)

Etiquetas

Preguntada:

el 19 de Oct. de 2017

Comentada:

el 20 de Oct. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by