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.

 採用された回答

Geoff Hayes
Geoff Hayes 2017 年 10 月 20 日

0 投票

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

1 件のコメント

Klio
Klio 2017 年 10 月 20 日
Great, thank you for your quick response.

サインインしてコメントする。

その他の回答 (0 件)

質問済み:

2017 年 10 月 19 日

コメント済み:

2017 年 10 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by