How to I find a x value from a given y?

596 views (last 30 days)
I have plotted a Matlab graph using a long matrix. I am looking to find the code which gives me an x value from the line graph given a y.

Accepted Answer

Thorsten
Thorsten on 2 Dec 2015
Edited: Thorsten on 2 Dec 2015
x(y==yourvalue)
or if you allow for some tolerance
tol = 1e-6;
x(abs(y-yourvalue) < tol)
  4 Comments
Coryn Melissa LLamoza Carabali
Hi, have the same problem you have. Were you able to get it to work?
Suhel Tamboli
Suhel Tamboli on 9 Mar 2021
Hello, how can I get y values for a range of x values (from a particular x value to another)?

Sign in to comment.

More Answers (1)

Salih CIL
Salih CIL on 11 Dec 2018
Thx it is working :)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!