필터 지우기
필터 지우기

Writing Compound Data to an Existing HDF5 file

조회 수: 6 (최근 30일)
Simon
Simon 2012년 7월 24일
I'm having difficulty adding a new compound dataset to an existing hdf5 file.
I get an error along the lines of:
***********************
Error using hdf5lib2 The HDF5 library encountered an error during execution of the 'H5Dcreate1' function, 'unable to create dataset'.
Error in H5D.create (line 40) id = H5ML.hdf5lib2('H5Dcreate', varargin{:} );
**************************
The easiest way to recreate this error is using the example script for writing MATLAB compound data to a hdf5 file on the hdfgroup.org website: http://www.hdfgroup.org/ftp/HDF5/examples/examples-by-api/matlab/HDF5_M_Examples/h5ex_t_cmpd.m
Basically, I run the script once so it create a file. Then I change
DATASET = 'DS1';
to
DATASET = 'DS2';
and
file = H5F.create(fileName);
to
file = H5F.open (fileName);
The aim is to create an identical dataset called DS2 inside of the same file as DS1. However, MATLAB throws the above error.
Any ideas what I'm doing wrong?

채택된 답변

John
John 2012년 7월 25일
You are opening the file in read-only mode, which is why the H5D.create call fails. Check the help for H5F.open, it has an example of what you need to do to modify your code.

추가 답변 (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