Main Content

cdflib.inquireAttr

Information about attribute

Syntax

info = cdflib.inquireAttr(cdfId,attrNum)

Description

info = cdflib.inquireAttr(cdfId,attrNum) returns information about an attribute 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.

attrNum

Numeric value that identifies the attribute in the file. Attribute numbers are zero-based.

Output Arguments

info

Structure containing the following fields.

FieldDescription
nameAttribute's name
scopeEither 'GLOBAL_SCOPE' or 'VARIABLE_SCOPE'
maxgEntryThe maximum entry number used for global attributes.
maxEntryThe maximum entry number used for attributes with variable scope.

Examples

Open the example CDF, and then get information about the first attribute in the file.

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

% Get information about an attribute
info = cdflib.inquireAttr(cdfId,0)
info = 

  struct with fields:

         name: 'SampleAttribute'
        scope: 'GLOBAL_SCOPE'
    maxgEntry: 4
     maxEntry: -1
% Clean up
cdflib.close(cdfId)
clear cdfId

References

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

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