MATLAB: Increase sample rate and interpolate to larger grid size

MATLAB: Increase sample rate and interpolate to larger grid size

interp2 increase sample rate extend grid region

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?

Best Answer

  • try
    Vq = interp2(vbxp,vbyp,bINT,vX,vY,’spline’);
  • Add a Comment

    Your email address will not be published. Required fields are marked *