This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Determine chunking settings for NetCDF variable


[storage,chunkSizes] = netcdf.inqVarChunking(ncid,varid)


[storage,chunkSizes] = netcdf.inqVarChunking(ncid,varid) returns the type of chunking and the dimensions of a chunk for the NetCDF variable specified by varid, in the file or group specified by ncid.

Input Arguments


Identifier of NetCDF file, returned by netcdf.create or, or of a NetCDF group, returned by netcdf.defGrp.


Identifier of NetCDF variable, returned by netcdf.defVar.

Output Arguments


Character vector specifying if NetCDF breaks the data into chunks when writing to a file. The value 'CHUNKED' indicates the data is chunked; 'CONTIGUOUS' indicates that the data is not chunked.


Array specifying the dimensions of the chunk.

Because MATLAB® uses FORTRAN-style ordering, the order of dimensions in chunkdims is reversed relative to what would be in the NetCDF C API.

If the storage type specified is CONTIGUOUS, netcdf.inqVarChunking returns an empty array, [].


This example opens the NetCDF sample dataset and gets the values of chunking parameters associated with a variable.

ncid ='','NOWRITE');
groupid = netcdf.inqNcid(ncid,'grid1');
varid = netcdf.inqVarID(groupid,'temp');
[storage,chunkSize] = netcdf.inqVarChunking(groupid,varid);


This function corresponds to the nc_inq_var_chunking function in the netCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

Was this topic helpful?