필터 지우기
필터 지우기

help with griddata (interpolate 2D data)

조회 수: 3 (최근 30일)
Felipe Silva
Felipe Silva 2018년 9월 28일
답변: ANKUR KUMAR 2018년 9월 29일
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