How can I write a struct data into h5 file?

Hello everyone,
I have opened a .h5 file with MATLAB and want to change a dataset, which datatype ist H5T_COMPOUND (struct). I have written a new struct data (same struct, just one field's value changed), do you know how to write it into h5 file? Thank you!
Best Regards
Xiao

Respuestas (4)

Sahithi Kanumarlapudi
Sahithi Kanumarlapudi el 16 de Dic. de 2019

0 votos

hdf5write' can be used to write data to a file in ‘.h5’ format.
For more information on how to use ‘hdf5write’ refer to the following link
per isakson
per isakson el 20 de Dic. de 2019
Editada: per isakson el 21 de Dic. de 2019

0 votos

If the Matlab support of HDF5 has not been updated in the most recent years there is no high level support for writing compound data to h5-files.
I found only this in the File Exchange Edit_struct_hdf5 by Renato Medeiros. It might be useful to you.
It can be done with the low level HFD5 functions, but I find it a bit tricky, YMMV. Did you study the low level Matlab samples at https://support.hdfgroup.org/HDF5/examples/api18-m.html, especially
  • Read / Write Compound Datatypes (Dataset) h5ex_t_cmpd.m and
  • Read / Write Compound Datatypes (Attribute) h5ex_t_cmpdatt.m
Xiao Jin
Xiao Jin el 16 de En. de 2020

0 votos

I solved the problem. Thanks for you help!

1 comentario

Richard Curry
Richard Curry el 6 de Abr. de 2020
Could you tell us how you solved the problem pleasse? I'm having the same issue.

Iniciar sesión para comentar.

Productos

Etiquetas

Preguntada:

el 13 de Dic. de 2019

Respondida:

el 9 de Feb. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by