Problem running linear fit y= m*x

2 vues (au cours des 30 derniers jours)
hellafella
hellafella le 22 Avr 2018
how do you run a linear fit for y= m*x. I don't want to use polyfit(x,y,1) as this gives y=mx+b.

Réponses (1)

Star Strider
Star Strider le 22 Avr 2018

Use the mldivide,\ (link) function:

m = x(:)\y(:);

Catégories

En savoir plus sur Linear and Nonlinear Regression dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by