cdflib.createAttr
Create attribute
Syntax
attrnum = cdflib.createAttr(cdfId,attrName,scope)
Description
attrnum = cdflib.createAttr(cdfId,attrName,scope)
creates an attribute in a CDF file with the specified scope.
Input Arguments
|
Identifier of a CDF file, returned by a call to | ||||||
|
Name you want to assign to the attribute, specified as a character vector or string scalar. | ||||||
|
Scope of the attribute, specified as one of these character vectors or string scalars, or its numeric equivalent.
To get the numeric equivalent of these constants, use the |
Output Arguments
|
Numeric value identifying the attribute. Attribute numbers are zero-based. |
Examples
Create a CDF, and then create an attribute in the CDF. To run this example, you must be in a writable folder.
cdfId = cdflib.create("your_file.cdf"); % Create attribute attrNum = cdflib.createAttr(cdfId,"Purpose","global_scope"); % Clean up cdflib.delete(cdfId) clear cdfId
Tips
This function corresponds to the CDF library C API routine
CDFcreateAttr
.To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.