Creating a selective meshgrid

2 views (last 30 days)
jack kostick
jack kostick on 17 Jun 2019
Commented: Matt J on 17 Jun 2019
I am trying to create a meshgrid of lat/lon coordinates, but because the resolution of the points is so fine, my computer runs out of memory and MATLAB aborts the process (see below):
nc=ncgeodataset(['CMC_reg_TMP_TGL_2_ps10km_',yyyymmdd,'00_P',...
chhh,'.grib2']);
nc.variables
dirvar=nc.geovariable(nc.variables(2));
dir=dirvar.data(1,:,:);
g=dirvar.grid_interop(1,:,:);
[glon,glat]=meshgrid(g.lon',g.lat);
Out of memory. Type HELP MEMORY for your options.
My end goal is to be able to extract a smaller grid of points from this giant meshgrid, can anyone think of a way to bypass that and just create the meshgrid to the specifications I need. The lat/ lon boundaries are: Lat: 45.37 to 53.07, Lon: -108.73 to -93.98.
I am on MATLAB R2011b FYI.
  1 Comment
Matt J
Matt J on 17 Jun 2019
Why not just start with the smaller destination grid?

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!