Main Content

cdflib.getVarCompression

Information about compression used by variable

Syntax

[ctype,cparams,percent] = cdflib.getVarCompression(cdfId, varNum)

Description

[ctype,cparams,percent] = cdflib.getVarCompression(cdfId, varNum) returns information about the compression used for a variable in a Common Data Format (CDF) File.

Input Arguments

cdfId

Identifier of a CDF file, returned by a call to cdflib.create or cdflib.open.

Output Arguments

ctype

Character vector identifying the type of compression. For a list of compression types, see cdflib.setCompression.

cparams

Any additional parameter required by the compression type.

percent

Numeric value indicating the level of compression, expressed as a percentage.

Examples

Open the example CDF file and check the compression settings of any variable.

cdfId = cdflib.open("example.cdf");

% Check the compression setting of any variable in the file
% The example checks the first variable
[ctype,params,percent] = cdflib.getVarCompression(cdfId,0)
ctype =

    'NO_COMPRESSION'


params =

     []


percent =

   100
% Clean up
cdflib.close(cdfId)
clear cdfId

Tips

  • This function corresponds to the CDF library C API routine CDFgetzVarCompression.

  • To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.