line equation from (x,y)

1 Ansicht (letzte 30 Tage)
Alireza Lashgary
Alireza Lashgary am 4 Aug. 2016
Bearbeitet: Star Strider am 4 Aug. 2016
Hi Friend I have 1000 x and y s . how i can find line equation for these points?

Antworten (1)

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

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by