This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Name of object


name = H5I.get_name(obj_id)
name = H5I.get_name(obj_id,'TextEncoding',encoding)


name = H5I.get_name(obj_id) returns the name of the object specified by obj_id. If no name is attached to the object, an empty character vector is returned.

name = H5I.get_name(obj_id,'TextEncoding',encoding) additionally specifies the text encoding to use to interpret the object name. Specify encoding as 'system'(default) or 'UTF-8'.

  • 'system' — Use the system default encoding to interpret the object name.

  • 'UTF-8' — Use UTF-8 encoding to interpret the object name.


Display the names of all the objects in the /g3 group in the example file by alphabetical order.

idx_type = 'H5_INDEX_NAME';
order = 'H5_ITER_INC';
fid ='example.h5');
gid =,'/g3');
info = H5G.get_info(gid);
for j = 1:info.nlinks
    obj_id = H5O.open_by_idx(fid,'g3',idx_type,order,j-1,'H5P_DEFAULT');
    name = H5I.get_name(obj_id);
    fprintf('Object %d: ''%s''.\n',j-1,name);