Write cell array of strings as attributes into H5 file

6 次查看(过去 30 天)
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
Sai Sri Pathuri 2020-3-2
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.

Community Treasure Hunt

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

Start Hunting!

Translated by