This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Create attribute


attr_id = H5A.create(loc_id,name,type_id,space_id,acpl_id)
attr_id = H5A.create(loc_id,name,type_id,space_id,acpl_id,aapl_id)


attr_id = H5A.create(loc_id,name,type_id,space_id,acpl_id) creates the attribute name that is attached to the object specified by loc_id. loc_id is a group, dataset, or named datatype identifier. The datatype and dataspace identifiers of the attribute, type_id and space_id, respectively, are created with the H5T and H5S interfaces. The attribute property list, acpl_id, is currently unused and should be set to 'H5P_DEFAULT'. This interface corresponds to the 1.6.x version of H5Acreate.

attr_id = H5A.create(loc_id,name,type_id,space_id,acpl_id,aapl_id) creates the attribute with the additional attribute access property list identifier aapl_id. aapl_id should currently be set to 'H5P_DEFAULT'. This interface corresponds to the 1.8.x version of H5Acreate.


acpl_id = H5P.create('H5P_ATTRIBUTE_CREATE');
type_id = H5T.copy('H5T_NATIVE_DOUBLE');
space_id = H5S.create('H5S_SCALAR');
fid = H5F.create('myfile.h5');
attr_id = H5A.create(fid,'my_attr',type_id,space_id,acpl_id);