Grid Resolution Changing by Bilinear Interpolation

조회 수: 3 (최근 30일)
Joydeb Saha
Joydeb Saha 2020년 5월 13일
댓글: KSSV 2020년 5월 13일
I have a matrix 1x721x1440 double, it has the vertical resolution 0.25x0.25 (in degrees). How can I change the grid resolution to 1x1 (in degrees) by bilinear interpolation method in matlab?

답변 (1개)

KSSV
KSSV 2020년 5월 13일
Let A be your 1X721X1440 data. And X, Y be your respect matrices with resolution 0.25.
A = squeeze(A) ;
xi = min(X(:)):1:max(X(:)) ;
yi = min(Y(:)):1:max(Y(:)) ;
[Xi,Yi] = meshgrid(xi,yi) ;
Ai = interp2(X,Y,A,Xi,Yi) ;
If you don't have respective X, Y; simply use
Ai = imresize(A,180,11) ;
Or
Ai = A(1:4:end,1:4:end) ;
  댓글 수: 2
Joydeb Saha
Joydeb Saha 2020년 5월 13일
My main data is 744x721x1440 (0.25x0.25 in degrees) double. Where Time = 744x1, Lat = 721x1, Lon = 1400x1. I do time averafe to it I got the resized data as 1 x 721 x 1440 (0.25x0.25 in degrees). So to transform the grid resolution to 1x1 (in degrees) I think second or third method will serve the purpose. Is it Sir ?
KSSV
KSSV 2020년 5월 13일
Yes...run a loop for each step.

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

카테고리

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