| Contents | Index |
h5writeatt(filename,location,attname,attvalue)
h5writeatt(filename,location,attname,attvalue) writes the attribute named attname with the value attvalue to the HDF5 file filename. The parent object location can be either a group or variable. location is the complete path name of the group or variable to which you want to associate the attribute.
Create a root group attribute whose value is the current time.
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','example.h5');
copyfile(srcFile,'myfile.h5');
fileattrib('myfile.h5','+w');
h5writeatt('myfile.h5','/','creation_date',datestr(now));
Create a double-precision data set attribute.
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','example.h5');
copyfile(srcFile,'myfile.h5');
fileattrib('myfile.h5','+w');
attData = [0 1 2 3];
h5writeatt('myfile.h5','/g4/world','attr',attData);
h5disp('myfile.h5','/g4/world');| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |