Find the point of the polyfit curve intersecting the x axis

38 visualizaciones (últimos 30 días)
Tushar Agarwal
Tushar Agarwal el 26 de Oct. de 2016
Comentada: KSSV el 26 de Oct. de 2016
Hello,
I used the polyfit function to generate a slope across my 2d data points. However, I want to store the value of x, at which this curve intersects the x axis, thus ('something',0).
Any idea how to get this point? All i see is the y intercept, and the slope of the line., not the x intercept

Respuesta aceptada

KSSV
KSSV el 26 de Oct. de 2016
use interpolation again... Let (x,y) be the points you have.
When curve intersects 'x' axes. y = 0.
xi = interp1(y,x,0) ;
  2 comentarios
Tushar Agarwal
Tushar Agarwal el 26 de Oct. de 2016
Thanks. However, what should I do if there are more than 1 values for y=0? I get an error for some of the plots saying 'only unique values'
KSSV
KSSV el 26 de Oct. de 2016
Check for x(y==0); It will give multiple values.Pick what you want.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by