removehdf5attribute

Removes the attribute at a given location.

Syntax

removehdf5attribute(filename, attributeName)

removehdf5attribute(filename, datasetPath, attributeName)

removehdf5attribute(filename, groupPath, attributeName)

Inputs

filename
Path to the HDF5 file.
Type: string
datasetPath/groupPath
Optional. Fully qualified path of the dataset/group in the file. File is considered as the location if this parameter is not provided.
Type: string
attributeName
The attribute name.
Type: string

Example 1

Remove an attribute.
%remove attribute on file
input_str = 'attribute on file';
createhdf5attribute('test.h5','attr_on_file_to_remove',input_str)
removehdf5attribute('test.h5','attr_on_file_to_remove')
      
%remove attribute on dataset
input_mat=[1,2;3,4];
createhdf5dataset('test.h5','/QUAD6',input_mat)
createhdf5attribute('test.h5','/QUAD6','attr_on_dataset_to_remove',input_mat)
removehdf5attribute('test.h5','/QUAD6','attr_on_dataset_to_remove')
      
%remove attribute on group
x=9;
createhdf5group('test.h5','/group6')
createhdf5attribute('test.h5','/group6','attr_on_group_to_remove',x)
removehdf5attribute('test.h5','/group6','attr_on_group_to_remove')