Get z values for given x and y.

12 views (last 30 days)
ASM Islam
ASM Islam on 26 Jun 2014
Answered: John D'Errico on 26 Jun 2014
Hello,
I generated a contourplot (say, plot 1) using x, y, z data. Now I've different x and y values that lie on the contourplot and want to get the z values (from plot 1) that correspond to those x and y values (that lies on plot 1, but not the ones used to generate plot 1). I'm an oceanographer, so not very skilled in Matlab, still left no stone unturned to figure this out but to no avail. I believe there has to be a way to do this. I'd highly appreciate if anyone could help. Thank you.
  2 Comments
Sara
Sara on 26 Jun 2014
Try looking at this function
griddata
Image Analyst
Image Analyst on 26 Jun 2014
Do you have a complete set of all x and y data? Or just some scattered points? Do you mind showing some code of yours?

Sign in to comment.

Answers (1)

John D'Errico
John D'Errico on 26 Jun 2014
You were not very clear about this.
If you generated a contour plot using contour, then interp2 is the tool to interpolate.
If you used scattered data points and then a tool from the FEX to generate the contours (tricontour) then use a tool like triscatteredinterp or griddata.

Community Treasure Hunt

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

Start Hunting!