%% Read Group and Dataset Attributes
% This example shows how to read group and dataset attributes of an HDF5 file.
% Return information about the root group of the HDF5 file. Read the attribute attr2 from the root group of the HDF5 file.

info1 = h5info('example.h5','/')
attval = h5readatt('example.h5','/','attr2')

% Return information about the dataset '/g4/lon'. Read the attribute units from this dataset.

info2 = h5info('example.h5','/g4/lon')
attval = h5readatt('example.h5','/g4/lon','units')

% Copyright 2019 The MathWorks, Inc.