How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
0 Commenti
Risposte (1)
Star Strider
il 10 Nov 2017
If you are referring to the line produced by the lsline function, this works:
figure(1)
scatter(1:10, rand(1, 10))
hl = lsline;
B = [ones(size(hl.XData(:))), hl.XData(:)]\hl.YData(:);
Slope = B(2)
Intercept = B(1)
0 Commenti
Vedere anche
Categorie
Scopri di più su Curve Fitting Toolbox in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!