How to store the result of a loop in a cell?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Joseph
am 17 Jan. 2019
Kommentiert: Joseph
am 17 Jan. 2019
Hi everyone
i have a matrix R(12*44) and X(12*1). i'm trying to take a linear regression for each column of matrix R in a for loop and store in a cell such as b, but seems like it just stores the regression of the last column. can you please help. here is the script that i'm using.
X=[ones(size(R(:,1))) X];
b=cell(44,1);
for i=44
c=regress(R(:,i),X);
b{i}=c;
end;
Thank you
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Linear Regression finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!