2D Interpolation & Extrapolation with non linear Sample grid points and nan
Mostrar comentarios más antiguos
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 comentarios
Jeffrey Clark
el 23 de Jun. de 2022
@Laurent Davenne, add ,'makima' to your interp2 which should cause extrapolation of available 2 or more points.
Torsten
el 23 de Jun. de 2022
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
el 24 de Jun. de 2022
Laurent Davenne
el 24 de Jun. de 2022
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Interpolation of 2-D Selections in 3-D Grids en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
