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

3 ビュー (過去 30 日間)
sH
sH 2017 年 11 月 10 日
回答済み: Star Strider 2017 年 11 月 10 日
Hello How to save and use the slope of fitted line in linear curve fitting as a variable in matlab?

回答 (1 件)

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

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by