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

Antworten (4)

Thorsten
Thorsten am 13 Nov. 2015

1 Stimme

help robustfit
the final exampel contains also a standard linear regression using "regress".
Star Strider
Star Strider am 13 Nov. 2015

0 Stimmen

And a third option:
B = [ones(size(x(:))) x(:)]\y(:);
slope = B(2)
intercept = B(1)
Image Analyst
Image Analyst am 13 Nov. 2015

0 Stimmen

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

Kategorien

Mehr zu Linear and Nonlinear Regression finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 13 Nov. 2015

Beantwortet:

am 13 Nov. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by