Skip to Main Content Skip to Search
Product Documentation

cdflib.getNumAttrEntries - Number of entries for attribute with variable scope

Syntax

nentries = cdflib.getNumAttrEntries(cdfId,attrNum)

Description

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

cdfId identifies the CDF file.

attrNum is a numeric value that specifies the attribute. Attribute numbers are zero-based. The attribute must have variable scope.

Examples

Open the example CDF, find an attribute with variable scope, and determine how many entries are associated with the attribute:

cdfid = cdflib.open('example.cdf');

% Get the number of an attribute
% with variable scope
attrNum = cdflib.getAttrNum(cdfid,'Description');

% Check that scope of attribute is variable
attrScope = cdflib.getAttrScope(cdfid,attrNum)

VARIABLE_SCOPE

% Detemine the number of entries for the attribute
attrEntries = cdflib.getNumAttrEntries(cdfid,attrNum)

attrEntries =

    4

% Clean up
cdflib.close(cdfid);

References

This function corresponds to the CDF library C API routine CDFgetNumAttrzEntries. To use these functions, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF Web site. For copyright information, see the cdfcopyright.txt file.

See Also

cdflib.getAttrScope

Tutorials

  


» Learn more
» Download free kit
» Get trial software

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS