How to retrieve z value from surf plot given x and y?

조회 수: 3 (최근 30일)
Kyle Gao
Kyle Gao 2018년 9월 19일
댓글: Kyle Gao 2018년 9월 19일
I got a surface useing:
s= surf(X, Y, Z)
Since the X, Y, and Z are discrete, I want to get the consecutive value of Z. For example, the origin data X and Y are all integers, and I don't the relationship between XY and Z, I want to get the z value where X = 1.87 and Y = 2.9. Is it possible? What should I do?

채택된 답변

Cedric
Cedric 2018년 9월 19일
편집: Cedric 2018년 9월 19일
where Xq and Yq are defined using the values given in your question.
  댓글 수: 3
Cedric
Cedric 2018년 9월 19일
Unless I misunderstand your question, you can just set
Xq = 1.87 ;
Yq = 2.9 ;
and have Zq with
Zq = interp2( X, Y, Z, Xq, Yq ) ;
Kyle Gao
Kyle Gao 2018년 9월 19일
Yeah! This solved my question perfectly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by