Write cell array of strings as attributes into H5 file
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Sai Sri Pathuri
on 2 Mar 2020
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.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!