Help with fitting linear equation

18 visualizzazioni (ultimi 30 giorni)
Mirelys Llana
Mirelys Llana il 13 Nov 2015
Risposto: Image Analyst il 13 Nov 2015
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

Risposte (4)

Sean de Wolski
Sean de Wolski il 13 Nov 2015
>>doc polyfit

Thorsten
Thorsten il 13 Nov 2015
help robustfit
the final exampel contains also a standard linear regression using "regress".

Star Strider
Star Strider il 13 Nov 2015
And a third option:
B = [ones(size(x(:))) x(:)]\y(:);
slope = B(2)
intercept = B(1)

Image Analyst
Image Analyst il 13 Nov 2015
See my attached polyfit demo that I have posted countless times.

Categorie

Scopri di più su Linear and Nonlinear Regression in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by