I am new to Matlab and am trying to reverse engineer a script used to read hdf5 files, need help with syntax for variables
조회 수: 4 (최근 30일)
이전 댓글 표시
I am new to matlab, and I am attempting to reverse engineer a script used to read hdf5 files. I have a dummy hdf5 file I am using to test it with and I am not sure the file has the correct # of attributes or columns.
the file structure is set up thus:
/Nodes
/Nodes/EmitterSystem
/Nodes/EntityState
with datasets under the EmitterSystem and EntityState groups. the file I have says it only has 1 attribute, which is the filename, however I have a section of code:
[AttributeSize ~] = size(HDF5Info.Datasets(a).Attributes);
for i=1:AttributeSize
AttributeIndex(i,1) = cellstr(HDF5Info.Datasets(a).Attributes(i).Name);
end
which to me looks like it is cycling through the attributes, then below it is trying to do a strcmp to compare values and set names if the values are correct. it keeps erroring out saying it is not getting the correct number of arguments. To me it looks as if the Attributes are incorrect, would that be a correct assumption?
댓글 수: 0
답변 (1개)
Richard Burnside
2023년 6월 26일
You could just remove the semi-colon from the end of the AttributeSize line:
[AttributeSize ~] = size(HDF5Info.Datasets(a).Attributes)
and then you will be able to see if there are actual Attributes encoded in the HDF5 file ([AttributeSize ~] will be displayed).
참고 항목
카테고리
Help Center 및 File Exchange에서 HDF5에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!