Creating HDF5 file: How to create a GROUP inside a GROUP?
Afficher commentaires plus anciens
Dear all
I'd like to create an HDF5 file ('file_ex.hdf') which should have the following structure:
>> h5disp('file_ex.hdf')
HDF5 file_ex.hdf
Group '/'
Attributes:
'Form': 'short'
Group '/ds1'
Group '/ds1/data1'
Dataset 'data'
Size: 1000x1200
Datatype: H5T_STD_U8LE (uint8)
Attributes:
'CLASS': 'Myclass'
'VERSION': 7.5
Group '/ds1/what'
Attributes:
'product': 'COMP'
'time': '000009'
Group '/what'
Attributes:
'Func': 'upper'
I managed to create an HDF5 file which contains the Attribute 'Form' and the Group '/ds1' -- but I did not manage to create a Group '/ds1/data1' contained in the Group '/ds1'. How can I create such a sub-group?
Here is the code I used:
>> h5create('file_ex.hdf','/ds1/data1',[10 20])
>> mydata = rand(10,20);
>> h5write('file_ex.hdf', '/ds1/data1', mydata)
>> h5writeatt('file_ex.hdf','/','Form','short');
The file generated by this code looks like this:
>> h5disp('file_ex.hdf')
HDF5 file_ex.hdf
Group '/'
Attributes:
'Form': 'short'
Group '/ds1'
Dataset 'data1'
Size: 10x20
MaxSize: 10x20
Datatype: H5T_IEEE_F64LE (double)
ChunkSize: []
Filters: none
FillValue: 0.000000
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur HDF5 dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!