Documentation

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.

cdflib.getAttrScope

Scope of attribute

Syntax

scope = cdflib.getAttrScope(cdfId,attrNum)

Description

scope = cdflib.getAttrScope(cdfId,attrNum) returns the scope of 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 specifies the attribute. Attribute numbers are zero-based.

Output Arguments

scope

One of the following character vectors, or its numeric equivalent.

ValueDescription
'GLOBAL_SCOPE'Attribute applies to the CDF as a whole.
'VARIABLE_SCOPE'Attribute applies only to the variable.

To get the numeric equivalent of these constants, use the cdflib.getConstantValue function.

Examples

Open example CDF and get the scope of the first attribute in the file:

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

attrScope = cdflib.getAttrScope(cdfid,0)

attrScope =

GLOBAL_SCOPE

% Clean up
cdflib.close(cdfid);

clear cdfid

References

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

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

For copyright information, see the cdfcopyright.txt file.

Was this topic helpful?