From: Vitezslav on
> Meng,
>
> Yes, as the document mentions, 'overwrite' will overwrite the entire
> contents of the file.
>
> To overwrite a specific dataset, just write to it again:
>
> >> hdf5write('myfile.h5', '/dataset1', uint8(5))
> >> hdf5read('myfile.h5','/dataset1')
>
> ans =
>
> 5
>
> >> hdf5write('myfile.h5', '/dataset1', uint8(10))
> >> hdf5read('myfile.h5','/dataset1')
>
> ans =
>
> 10

hello,
maybe I miss the point, but IMHO the above example
overwrites the entire contents of the file too.
An example with two datasets:

>> hdf5write('myfile.h5', '/dataset1', uint8(5))
>> hdf5write('myfile.h5', '/dataset2', uint8(5),'WriteMode', 'append')

you have NO possibility to change the values of dataset1 without destroying dataset2:

1. try WriteMode append:
>> hdf5write('myfile.h5', '/dataset1', uint8(10),'WriteMode', 'append')
??? Error using ==> hdf5writec
writeH5Dset: Dataset names must be unique when appending data.

2. without try WriteMode append (default mode is 'overwrite')
>> hdf5write('myfile.h5', '/dataset1', uint8(10))
>> hdf5read('myfile.h5','/dataset1')
ans =
10
>> hdf5read('myfile.h5','/dataset2')
??? Error using ==> hdf5readc
/dataset2 is not a dataset.

that means that the entire contents of the file was rewritten,
not only the specific dataset1.

with best wishes
vita