Get z values for given x and y.

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

Try looking at this function
griddata
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.

Categories

Find more on Interpolation in Help Center and File Exchange

Asked:

on 26 Jun 2014

Answered:

on 26 Jun 2014

Community Treasure Hunt

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

Start Hunting!