Main Content

Group (H5G)

Organization of objects in file

Description

Use the MATLAB®HDF5 group interface,H5G, to create, open, close, and access information about groups in an HDF5 file.

Groups are structures that contain other objects in the HDF5 file. Typically, groups contain other groups and datasets.

Functions

H5G.close

Close group

H5G.close(groupID)releases resources used by the group identifier specified bygroupID. The identifiergroupIDwas returned by eitherH5G.createorH5G.open.

H5G.create

Create group

groupID = H5G.create(locID,groupname,size)creates a new group with the name specified bygroupnameat the location specified bylocID. This syntax corresponds to theH5Gcreateinterface in version 1.6 of the HDF5 C library.

groupID = H5G.create(locID,groupname,lcplID,gcplID,gaplID)creates a new group with additional property list, specified bylcplID,gcplID, andgaplID. This syntax corresponds to theH5Gcreateinterface in version 1.8 of the HDF5 C library.

Details

H5G.flush

Flush all data buffers to disk (since R2021b)

H5G.flush(groupID)causes all buffers associated with a groupgroupIDto be immediately flushed to disk without removing the data from the cache.

H5G.get_info

Information about group

info = H5G.get_info(groupID)returns information about the group specified bygroupID.

H5G.open

Open specified group

groupID = H5G.open(locID,groupname)opens the group specified bygroupnameat the location specified by the file or group identifierlocID. This function corresponds to theH5Gopeninterface in version 1.6 of the HDF5 C library.

groupID = H5G.open(locID,groupname,gaplID)opens the group with an additional group access property list specified bygaplID. This function corresponds to theH5Gopeninterface in version 1.8 of the HDF5 C library.

H5G.refresh

Clear and reload all data buffers (since R2021b)

H5G.refresh(groupID)causes all buffers associated with a group specified bygroupIDto be cleared and immediately reloaded with updated contents from disk.

Examples

expand all

Create an HDF5 file'myfile.h5'with a group'my_group'with default property list settings.

fid = H5F.create('myfile.h5'); plist ='H5P_DEFAULT'; gid = H5G.create(fid,'my_group',plist,plist,plist); H5G.close(gid); H5F.close(fid);
fid = H5F.open('example.h5'); gid = H5G.open(fid,'/g2'); info = H5G.get_info(gid); H5G.close(gid); H5F.close(fid);

版本历史

Introduced before R2006a