Why am I unable to read MAT-files with the HDF5READ function, even when they are saved with the "-v7.3" flag?

조회 수: 5 (최근 30일)
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, ...

채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
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개)

카테고리

Help CenterFile Exchange에서 HDF5에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by