Interpolate value of point

조회 수: 6 (최근 30일)
Aleksey Gureev
Aleksey Gureev 2021년 2월 9일
댓글: Aleksey Gureev 2021년 2월 9일
Hello. I have a sufrace like on the image.How can I interpolate z-value (black cross) from this surface? I need the fastest methos (linear, for example)

채택된 답변

Bob Thompson
Bob Thompson 2021년 2월 9일
I'm assuming you have the data for the surface points. If so, I believe interp2 will do what you're asking.
  댓글 수: 2
Aleksey Gureev
Aleksey Gureev 2021년 2월 9일
편집: Aleksey Gureev 2021년 2월 9일
Hello. Thank you for your answer. How can I use it? I tried like this
interp2(X, Y, V, 0, 0) - if I want to get at x = 0, y = 0, but It doen't work for me. Numbers in X and Y not monotonic.
Aleksey Gureev
Aleksey Gureev 2021년 2월 9일
Solved
xv = linspace(min(x), max(x), 20);
yv = linspace(min(y), max(y), 20);
[X,Y] = meshgrid(xv, yv);
Z = griddata(x,y,z,X,Y);
interp2(X, Y, V, 0, 0)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by