MATLAB: How to find the x value from a graph at y = 37

estimatinggraphinterpolationplotting

Hi there,
I let x=linspace(0, 100, 100) and let y = x^2+6. How do I get from the graph the value of x that gives y = 37? It needs to be from the graph itself like by interpolation rather than just reversing the equation!
Thanks!

Best Answer

Use the interp1 (link) function:
x=linspace(0, 100, 100);
y = x.^2+6;
xi = interp1(y, x, 37)
xi =
5.5448
Related Question