Retrieve just the slope in polyfit
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to return a vector containing just the slopes of various regressions so I can compare them. Right now I have a loop:
for i=1:n
slope{i}=polyfit(x,y(:,i),1)
end
However, this gives me a 1xn cell with each cell having a 1x2 double with slope AND intercept. I just want a nx1 vector containing the slopes. Any help would be greatly appreciated!
0 Kommentare
Akzeptierte Antwort
daniel.x16
am 28 Dez. 2011
1 Kommentar
Jan
am 28 Dez. 2011
Sorry, Daniel.x16, but this produces this error in Matlab 2009a and 2011b:
Error: ()-indexing must appear last in an index expression.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Linear and Nonlinear 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!