%% Write Attribute to Dataset
% Create an array of doubles and write it to the dataset /g4/world.

attData = [0 1 2 3];
h5writeatt('examplefile.h5','/g4/world','val2',attData);

% Display the dataset metadata. The attribute val2 is listed one of the attributes belonging to the dataset.

h5disp('examplefile.h5','/g4/world');

% Copyright 2019 The MathWorks, Inc.