Help with coding a bilinear interpolation function

조회 수: 4 (최근 30일)
Taras Goral
Taras Goral 2018년 7월 19일
댓글: Taras Goral 2018년 8월 1일
My specific problem involves taking, let's say, matrix1, which contains a n*m two dimensional array with a variable set to a certain value at each point, and interpolating the variable values at each point to points in matrix2, which contains a finer mesh of points in the same domain n*m.
I found that for my needs, I will be using a bilinear interpolation, but have some questions in how to code in within MatLab. First, is there any function to easily do this, or if not, how could I find and identify the four nearest points (in the image, 1, 2, 3 and 4) in matrix1 that bound a single point in matrix2 (5)?
Image for reference: https://imgur.com/jfiMtYf
After that, I think I could manage coding the bilinear interpolation itself (finding the two x-axis points and using those to find the point in matrix2).
Thanks for any answers in advance for my question about identifying the four bounding points.

채택된 답변

Matt J
Matt J 2018년 7월 19일
You can just use interp2() or griddedInterpolant().
  댓글 수: 7
Matt J
Matt J 2018년 7월 27일
편집: Matt J 2018년 7월 27일
Your link is broken for some reason. Why not just embed your image in your comments? That would be the easiest.
Taras Goral
Taras Goral 2018년 8월 1일
Sorry for that, here's the image:

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by