Help with fitting linear equation

I need help with my HW pls, I have a data set and I have to fit a linear equation on a given data to identify the intercept and the slope

回答 (4 件)

Thorsten
Thorsten 2015 年 11 月 13 日

1 投票

help robustfit
the final exampel contains also a standard linear regression using "regress".
Star Strider
Star Strider 2015 年 11 月 13 日

0 投票

And a third option:
B = [ones(size(x(:))) x(:)]\y(:);
slope = B(2)
intercept = B(1)
Image Analyst
Image Analyst 2015 年 11 月 13 日

0 投票

See my attached polyfit demo that I have posted countless times.

カテゴリ

ヘルプ センター および File ExchangeLinear and Nonlinear Regression についてさらに検索

質問済み:

2015 年 11 月 13 日

回答済み:

2015 年 11 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by