Define chunking behavior for NetCDF variable
netcdf.defVarChunking(ncid,varid,storage,chunkDims)
netcdf.defVarChunking(ncid,varid,storage,chunkDims)
sets the chunk
settings for the variable specified by varid
. Chunking is a technique
to improve performance. storage
specifies the type of chunking to use
and chunkDims
specifies the extents of the chunk size. You must
specify the chunk size used with a variable after creating the variable but before you
write data to the variable.
You cannot specify the chunk size for variables in a NetCDF
file created with the netCDF-3 mode (CLASSIC_MODEL
).
|
Identifier of NetCDF file, returned by |
|
Identifier of a NetCDF variable, returned by |
|
Character vector or string scalar specifying whether NetCDF should break the variable into
chunks when writing to a file. If set to |
|
Array specifying the dimensions of the chunk. Because MATLAB® uses FORTRAN-style ordering, the order of
dimensions in If storage is Default: Chunk size determined by the NetCDF library. |
This example creates a NetCDF file and specifies the chunking behavior of a variable.
ncid = netcdf.create('myfile.nc','NETCDF4'); latdimid = netcdf.defDim(ncid,'lat',1800); londimid = netcdf.defDim(ncid,'col',3600); varid = netcdf.defVar(ncid,'earthgrid','double',[latdimid londimid]); netcdf.defVarChunking(ncid,varid,'CHUNKED',[180 360]); netcdf.close(ncid);
This function corresponds to the nc_def_var_chunking
function
in the NetCDF library C API.
For copyright information, read the netcdfcopyright.txt
and mexnccopyright.txt
files.