Why am I unable to read MAT-files with the HDF5READ function, even when they are saved with the "-v7.3" flag?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have saved some data in an HDF-format MAT-file using the SAVE commands:
for i = 1:2
x(i).a= rand;
end
save('test.mat','x','-v7.3') ;
where "x" is a structure with a field "a" .
However, when I use high-level HDF5 functions to read this file, it fails. For instance, when executing
hdf5read('test.mat', '/x/a')
I receive the error:
??? Error using ==> hdf5readc
H5T_REFERENCE types cannot be read using hdf5read.
Similarly, HDF5READ fails even if HDF5INFO works fine.
For instance, when I execute the following:
hinfo = hdf5info('test.mat');
hdf5read(hinfo.GroupHierarchy.Groups(2).Datasets(1))
I receive the error:
??? Error using ==> hdf5readc
H5T_REFERENCE types cannot be read using hdf5read.
Error in ==> hdf5read at 88
[data, attributes] = hdf5readc(settings.filename, ...
Réponse acceptée
MathWorks Support Team
le 27 Juin 2009
This occurs because MATLAB's high-level HDF5 functions like HDF5READ do not support references. HDF5READ and HDF5INFO only work on files like those which are created by HDF5WRITE, which use nested structures in the file instead of references.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur HDF5 dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!