hdf5 file read problem.

66 次查看(过去 30 天)
Mahdi
Mahdi 2015-9-24
Hi, I have a series of cgns files which I want to process in Matlab. I use a command of cgnstools in linux named adf2hdf and also cgnsconvert to convert the cgns files into hdf5 files. I can get the structures with h5info and h5disp, but when I want to use h5read it complains with following error:
Error using h5readc
The HDF5 library encountered an error and produced the following stack trace information:
H5Dopen2 not a dataset
Error in h5read (line 59)
[data,var_class] = h5readc(Filename,Dataset,start,count,stride);
A sample file has been attached. I had to change the extension to png so I can upload it. After download you can change it back to hdf5 but it doesn't really matter for Matlab.

采纳的回答

per isakson
per isakson 2015-9-26
编辑:per isakson 2015-10-2
I would call this a practical joke. There is a leading space in the names of the datasets. (Caveat: This is the first time I encounter the CFD General Notation System.)
You didn't tell what you tried to read, however, try
>> num = h5read( 'h:\m\cssm\xy.h5', '/ format' )'
num =
73 69 69 69 95 76 73 84 84 76 69 95 51 50 0
and
>> num = h5read( 'h:\m\cssm\xy.h5', '/xyplane/sidesplane/ZoneType/ data' )'
num =
85 110 115 116 114 117 99 116 117 114 101 100
This is an excerpt of a h5disp output.
  1 个评论
Mahdi
Mahdi 2015-9-28
lol, can't believe I missed the space but that was it!

请先登录,再进行评论。

更多回答(0 个)

标签

Community Treasure Hunt

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

Start Hunting!

Translated by