How to create a HDF5 group with only attributes

2 ビュー (過去 30 日間)
HaMo
HaMo 2023 年 9 月 7 日
Writing an attribute to a group that already has a dataset works fine:
h5create("sample.hdf5", "/group/dataset", 1:3)
h5writeatt("sample.hdf5", "/group/", "attribute", 3.14)
But I cannot create attributes in files that do not alredy exist:
h5create("sample2.hdf5", "/group1/dataset", 1:3)
h5writeatt("sample2.hdf5", "/group2/", "attribute", 3.14)
Error using hdf5lib2
The HDF5 library encountered an error and produced the following stack trace information:
H5G_loc_find_cb object 'group2' doesn't exist
(...)
There is no "create attribute" function as there is for datasets. I understand this constraint may be there for a purpose, but is there a workaround?

回答 (0 件)

カテゴリ

Help Center および File ExchangeHDF5 についてさらに検索

タグ

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by