Effacer les filtres
Effacer les filtres

How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?

5 vues (au cours des 30 derniers jours)
Hello How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?

Réponses (1)

Star Strider
Star Strider le 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)

Catégories

En savoir plus sur Get Started with Curve Fitting Toolbox dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by