Problem running linear fit y= m*x

9 visualizaciones (últimos 30 días)
hellafella
hellafella el 22 de Abr. de 2018
Respondida: Star Strider el 22 de Abr. de 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.

Respuestas (1)

Star Strider
Star Strider el 22 de Abr. de 2018

Use the mldivide,\ (link) function:

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

Categorías

Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by