Grid Resolution Changing by Bilinear Interpolation
2 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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) ;
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!