How to get the different z coordinates associated with a single (x,y) coordinate in a plot?
Show older comments
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
Jan
on 13 Jun 2018
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?
Pasindu Samaranayake
on 14 Jun 2018
Jan
on 14 Jun 2018
I cannot zoom into the image. But it would help if you reveal the detail, how the data are stored in Matlab.
Answers (1)
KSSV
on 14 Jun 2018
0 votes
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.
Categories
Find more on Surface and Mesh 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!