How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?
0 件のコメント
回答 (1 件)
Star Strider
2017 年 11 月 10 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Curve Fitting Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!