Why do I get an error when creating an empty, zero-length HDF5 dataset with using "h5create" in MATLAB R2024b?
Show older comments
I have a workflow where I need to always include certain datasets in my HDF5 files, even if they are empty for a particular run. This is important for maintaining a consistent file structure and for attaching attributes to these datasets for self-documentation. However, when I try to use "h5create" in MATLAB to create a fixed-size, zero-length dataset (e.g., [0 0]), I receive an error. Is there a way to create an empty HDF5 dataset with attributes in MATLAB?
Here are the steps I tried:
>> h5create("test.h5", "/0x0", [0, 0], Datatype="uint8", Chunksize=[0, 0])
Here is the error I receive:
Error using matlab.internal.sci.hdf5lib2
The HDF5 library encountered an error and produced the following stack trace information:
H5Pset_chunk all chunk dimensions must be positive
Accepted Answer
More Answers (0)
Categories
Find more on HDF5 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!