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!

回答(1 个)

darova
darova 2021-3-22
What about interp2? If (x,y) are known z coord can be found
z1 = interp2(x0,y0,z0,x1,y1);

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by