Interpolating latitudes and longitudes

조회 수: 4 (최근 30일)
emhol241
emhol241 2018년 10월 28일
편집: jonas 2018년 10월 28일
I have a set of latitudes and longitudes (both 506 x 270) sampled at 5km resolution and need it in 1km resolution (size 2030 x 1354). How do I interpolate between points to do this?

답변 (1개)

jonas
jonas 2018년 10월 28일
편집: jonas 2018년 10월 28일
lat and lon are your 5-km-resolution arrays and v (506x270) is the variable you want to interpolate.
% create finer grid
[latq lonq] = meshgrid(min(lat(:)):1:max(lat(:)),min(lon(:)):1:max(lon(:)))
% interpolate
vq = griddata(lat,lon,v,latq,lonq)
  댓글 수: 2
emhol241
emhol241 2018년 10월 28일
I am confused as to what I use as v... I need to interpolate lat and long themselves?
I have a variable which is already 2030x1354 (i.e. 5 times the size of lat and long) and cannot do the data analysis I want until I have the coordinates in the same size as the variable
jonas
jonas 2018년 10월 28일
편집: jonas 2018년 10월 28일
Oh.. then just use meshgrid to build your grid without interpolating. Just skip the second part. I just assumed that your 5 km grid resolution had some meaning because you mentioned it, as well as interpolation, in the question... Creating a grid has nothing to do with either.

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

카테고리

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