line equation from (x,y)

5 visualizzazioni (ultimi 30 giorni)
Alireza Lashgary
Alireza Lashgary il 4 Ago 2016
Modificato: Star Strider il 4 Ago 2016
Hi Friend I have 1000 x and y s . how i can find line equation for these points?

Risposte (1)

Star Strider
Star Strider il 4 Ago 2016
Modificato: Star Strider il 4 Ago 2016
For a linear fit, use the mldivide,\ operator:
b = [ones(size(x(:))) x(:)]\y(:);
slope = b(2)
intercept = b(1)

Categorie

Scopri di più su Mathematics and Optimization in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by