help with griddata (interpolate 2D data)

1 次查看(过去 30 天)
Hello,
I have a map with lon(1101x1) and lat(1001x1) and sst(1101x1001) and im trying to interpolate this for another map i have(290x940). Im using griddata function but after hours i get a vq=[ ]. Something deleted the values.
Workspace: grade (1101x1001) sst (1101x1001) lat_rho (290x940) lon_rho (290x940)
vq=griddata(grade,grade,sst,lon_rho,lat_rho);
What is going wrong?
Thanks for the attention

回答(1 个)

ANKUR KUMAR
ANKUR KUMAR 2018-9-29
Since you have not uploaded any data set, I am taking an example to resolve your issue.
lon=[65:95];
lat=[0:35];
var1=rand(36,31);
Suppose you wish to interpolate var1 over different grids.
Lets take new grid latitude as 0:0.1:35 and longitude as 65:0.1:95
lon1=[65:0.1:95];
lat1=[0:0.1:35];
[xx,yy]=meshgrid(lat1,lon1);
var1_interpolated=interp2(lat,lon,var1',xx,yy);

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by