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 compression settings for NetCDF variable


[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(ncid,varid)


[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(ncid,varid) returns the compression parameters for the NetCDF variable specified by varid in the location specified by ncid.

Input Arguments


Identifier of a 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


Boolean value. true indicates that the shuffle filter is enabled for the specified variable. The shuffle filter can assist with the compression of integer data by changing the byte order in the data stream.


Boolean value. true indicates that compression is enabled for this variable. The deflateLevel argument specifies the level of compression.


Scalar value between 0 and 9 specifying the amount of compression, where 0 is no compression and 9 is the most compression


This example opens the NetCDF sample file and gets information about variable compression.

ncid ='','NOWRITE');
groupid = netcdf.inqNcid(ncid,'grid1');
varid = netcdf.inqVarID(groupid,'temp');
[shuffle,deflate,deflateLevel] = netcdf.inqVarDeflate(groupid,varid);


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

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

Was this topic helpful?