フィルターのクリア

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.
  1 件のコメント
Simon
Simon 2012 年 7 月 25 日
Thanks again, John!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeHDF5 についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by