Interpolate value of point

2 次查看(过去 30 天)
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