line equation from (x,y)

5 visualizaciones (últimos 30 días)
Alireza Lashgary
Alireza Lashgary el 4 de Ag. de 2016
Editada: Star Strider el 4 de Ag. de 2016
Hi Friend I have 1000 x and y s . how i can find line equation for these points?

Respuestas (1)

Star Strider
Star Strider el 4 de Ag. de 2016
Editada: Star Strider el 4 de Ag. de 2016
For a linear fit, use the mldivide,\ operator:
b = [ones(size(x(:))) x(:)]\y(:);
slope = b(2)
intercept = b(1)

Categorías

Más información sobre Mathematics and Optimization en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by