Write cell array of strings as attributes into H5 file
显示 更早的评论
Hi,
How can I specify an attribute to an H5 element to be an array of strings, not just a single string?
For example, I would like to be able to do this:
h5writeatt([ 'filename.h5'],['/metadata'],'attribute1',["a", "b", "c"])
But of course it does not work (square and curly brackets both do not help, nor does changing " to '), as the input for the attribute cannot be a cell, as I get the error 'cell' is not supported as an attribute datatype.
I have found this previous question https://de.mathworks.com/matlabcentral/answers/66820-how-to-put-a-string-in-a-dataset-attribute, but I don't think the answer was helpful as the suggested method writes string array data and not string array attributes.
I have R2018b. Thanks in advance.
回答(1 个)
Sai Sri Pathuri
2020-3-2
1 个投票
As of now, there is no option to specify an attribute of an H5 element as an array of strings in R2018b or latest versions. It might be considered in any future release.
类别
在 帮助中心 和 File Exchange 中查找有关 HDF5 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!