how to load big netcdf file?
17 views (last 30 days)
Show older comments
TESFALEM ALDADA
on 1 Feb 2022
Answered: Benjamin Thompson
on 1 Feb 2022
Hello
I was wondering why Matlab could not able to load 3GB file to the work space. I have Netacdf file format with 3GB an di tried to load it to the work space using ncread as shown below. but it results in error message.
Does any has better ideas for this error.
P = ncread('v2p0chirps_25.nc','precip');
Error using netcdflib
Requested 1440x400x14853 (31.9GB) array
exceeds maximum array size preference.
Creation of arrays greater than this
limit may take a long time and cause
MATLAB to become unresponsive. See
array size limit or preference panel
for more information.
Error in netcdf.getVar (line 140)
data =
netcdflib(funcstr,ncid,varid,varargin{:});
Error in
internal.matlab.imagesci.nc/read (line
605)
data =
netcdf.getVar(gid,
varid);
Error in ncread (line 66)
vardata = ncObj.read(varName,
varargin{:});
0 Comments
Accepted Answer
Benjamin Thompson
on 1 Feb 2022
The ncread function accepts additional arguments for a starting position and number of elements to read. See the help on ncread. Or you could increase array size limit in the MATLAB preferences as your error suggests. Looks like MATLAB wants a 31.9GB array though so that might be hard to do.
0 Comments
More Answers (0)
See Also
Categories
Find more on NetCDF in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!