2D Interpolation & Extrapolation with non linear Sample grid points and nan
이전 댓글 표시
Hi,
I have this 2D map wich I would like to interpolate to make square but also extrapolate.

interp2 does seem to work with nan inputs as it just returns same nan as output.
V=[1.029 1.000 1.060 1.048 nan nan nan
1.049 1.014 1.038 1.092 1.075 nan nan
nan 1.039 1.079 1.036 1.029 1.003 nan
nan nan 1.042 1.072 1.000 0.998 1.028
nan nan nan 1.038 1.024 1.076 1.022
nan nan nan nan 1.082 0.997 1.011];
X=[8 10 15 25 35 45 52];
Y=[5 10 16.25 22.5 28.75 35];
Xq=ones(numel(Y),numel(X)).*X;
Yq=ones(numel(Y),numel(X)).*Y';
Z=interp2(X,Y,V,Xq,Yq)
I tried some inpaint functions from the community but none of them seems to be made to work with non linear sample grid points (0 2 7 17...).
I am open to suggestions
Thanks in Advance
Laurent
댓글 수: 4
Jeffrey Clark
2022년 6월 23일
@Laurent Davenne, add ,'makima' to your interp2 which should cause extrapolation of available 2 or more points.
Torsten
2022년 6월 23일
interp2 does seem to work with nan inputs as it just returns same nan as output.
Everything else would have been a surprise. What do you expect ?
Laurent Davenne
2022년 6월 24일
Laurent Davenne
2022년 6월 24일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation of 2-D Selections in 3-D Grids에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
