How to get the different z coordinates associated with a single (x,y) coordinate in a plot?

I have already plotted the 3d plot using plot3 function as shown below;
As you can see, many lines are intersecting each other, which means that for a given (x,y) coordinate there are multiple z coordinates. Is there a way where I can break down the whole grid into small intervals and then run a loop for each X and Y value to extract all the Z coordinates occurring at one particular (x,y) point? currently I have broken down the plot into small intervals as shown in this code
gcf K = linspace(min(xlim),max(xlim),10000); J = linspace(min(ylim),max(ylim),10000); Q = K'; E = J'; for m = 1:length(Q)
but I don't know how to proceed. Any help is appreciated

3 Comments

As you can see, many lines are intersecting each other,
I cannot see this. Why does what mean, that "there are multiple z coordinates"? How are the data stored?
If you look closely at the image, (zoomed in for example), you can see multiple lines overlapping and intersecting each other at different points. Think of it like a large network of pipes , with pipes present at different heights. When you look from the top, there are many points where the pipes intersect each other. These intersecting and overlapping points have the same (x,y) coordinates, but they many not have the same z coordinate because the pipes are at different heights.
I cannot zoom into the image. But it would help if you reveal the detail, how the data are stored in Matlab.

Sign in to comment.

Answers (1)

If you have the data of (x,y,z) in hand....and you have the intersecting points (xp,yp) in hand. YOu can get associated z in different ways. YOu have all the lines in your hand....use the points (xp,yp) to find out on which line, they lie and get the respective zp. You need to check with all different lines you have with you.

Asked:

on 13 Jun 2018

Commented:

Jan
on 14 Jun 2018

Community Treasure Hunt

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

Start Hunting!