Need help finding the z-coordinate of a 3D surface given a known x and y coordinate
2 次查看(过去 30 天)
显示 更早的评论
I'm having trouble figuring out how to extract the z-coordinate intersection from a 3D plot when the x and y coordinate are known. The x and y planes in the image bllow are drawn for reference only for x = 0.1 and y = 0.4. Note also that the z-surface is not a uniform plane but rather a surface with a slight bit of tilt/twist. In this example, when x = 0.1 and y = 0.4, the intersection is: z = 0.814. I was able to manually find the intersection via the plot tools (ie clicking data types, then clicking the point of interest on the plot) but I need to code up a function that will take an x and y input and then spit out the z-coordinate. Also, the functino needs to return "NaN" for an answer if looking for the Z-coordinate where the z-surface doesnt exist (see: upper left most section of the z-surface)
For an experienced Matlab user, this is probably very simple to do but I'm struggling with it and would really appreciate a little help.
Thank you!
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/557487/image.png)
0 个评论
回答(1 个)
darova
2021-3-22
What about interp2? If (x,y) are known z coord can be found
z1 = interp2(x0,y0,z0,x1,y1);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!