MATLAB: How to find value of X if i know Y value

interpolationode45

I have solved an ODE, then I plotted the solution. The x-axis range from 0 to .8, and the y-axis range from 0 to -0.06. I would like to know the exact value of x-axis at which the y-axis=-0.05

Best Answer

Assuming that ‘y’ is monotonically increasing or decreasing (not oscillating), one approach would be:
xv = interp1(y, x, -0.05, 'linear')
NOTE Since I do not have your data, this is UNTESTED CODE. It should work.