Increase sample rate and interpolate to larger grid size

5 vues (au cours des 30 derniers jours)
K G
K G le 9 Juin 2016
Commenté : Joydeb Saha le 17 Oct 2021
I currently have a grid, bINT, that extends from 1.25 km to 32.5 km in the horizontal (x) direction and from 0 s to 0.5 s in the vertical (y) dimension.
The grid is sampled currently with dx=0.625 km and dy=0.01 s.
I would like to do two things: 1 - extend/interpolate the horizontal grid dimensions to 0.00625-35 km 2 - increase the sample rate of the grid to dx=0.00625 km and dy=0.001 s
I have tried using interp2 to do both of these things in one go, this works, but places NaN values in the horizontally extended region. I could replace this with an average value, but it is not very representitve
Vq = interp2(vbxp,vbyp,bINT,vX,vY);
where vbxp=[1.25:0.625:32.5]'; vbx=[0.00625:0.00625:35]'; vbyp=[0:0.1:0.5]'; vby=[0:0.001:0.5]'; [vX,vY]=meshgrid(vbx,vby);
I want the smaller grid to be extended by horizontally smoothing, basically, because the real data is fairly consistent horizontally but not vertically.
Any suggestions, to improve this method?

Réponse acceptée

KSSV
KSSV le 9 Juin 2016
try
Vq = interp2(vbxp,vbyp,bINT,vX,vY,'spline');
  2 commentaires
K G
K G le 9 Juin 2016
Great, works nicely thanks.
Joydeb Saha
Joydeb Saha le 17 Oct 2021
I have a data file D.mat. Its 2.5x2.5 grid data. lat x long is 73x144. lant range +-90, long range +-180.
How can I make it 0.5x0.5 grid data.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by