0

I have plotted some data in MATLAB (see figure below). How can I extract the x and y intercepts from the plot without manually estimating them?

plot with two lines

Cris Luengo
  • 55,762
  • 10
  • 62
  • 120
Elias S.
  • 221
  • 1
  • 3
  • 10
  • How did you plot the data? Your plot inputs should be your x and y interceptions. – zeeshan khan Mar 09 '19 at 21:13
  • I am not sure I understand what you mean. The data I have plotted are not continous points. Its a finite number of points which do not necesserily include points on the interceptions. – Elias S. Mar 10 '19 at 00:08

1 Answers1

1

Try this:

x0 = interp1(y,x,0,'spline');
y0 = interp1(x,y,0,'spline');

Similar question/answer here, except you'll need to play with the method and maybe even the extrapolation as described on this Matlab page.

a11
  • 3,122
  • 4
  • 27
  • 66