Main Content

cdflib.getNumAttrgEntries

Number of entries for attribute with global scope

Syntax

nentries = cdflib.getNumAttrgEntries(cdfId,attrNum)

Description

nentries = cdflib.getNumAttrgEntries(cdfId,attrNum) returns the number of entries written for the specified global attribute in the Common Data Format (CDF) file.

cdfId identifies the CDF file. attrNum is a numeric value that identifies the attribute. Attribute numbers are zero-based. The attribute must have global scope.

Examples

Open the example CDF and find out how many entries are associated with a global attribute in the file.

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

% The first attribute is a global attribute
attrgEntries = cdflib.getNumAttrgEntries(cdfId,0)
attrgEntries =

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

References

This function corresponds to the CDF library C API routine CDFgetNumAttrgEntries.

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