Need help finding the z-coordinate of a 3D surface given a known x and y coordinate

조회 수: 5 (최근 30일)
JimmyB
JimmyB 2021년 3월 21일
답변: darova 2021년 3월 22일
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