| Contents | Index |
h5write(filename,datasetname,data)
h5write(filename,datasetname,data,start,count)
h5write(filename,datasetname,data,start,count,stride)
h5write(filename,datasetname,data) writes data to an entire data set, datasetname, in the HDF5 file, filename.
h5write(filename,datasetname,data,start,count) writes a subset of the data to a data set, datasetname, in the HDF5 file, filename. start is a one-based index value that specifies the first element to be written. count specifies the number of elements to write along each dimension. h5write extends an extendable data set along any unlimited dimensions, if necessary.
h5write(filename,datasetname,data,start,count,stride) writes a hyperslab of data, where stride specifies the inter-element spacing along each dimension.
A hyperslab is a collection of points in a data space. The points can be contiguous or form a regular pattern of points or blocks in a data space.
Write to an entire data set.
h5create('myfile.h5','/DS1',[10 20]);
mydata = rand(10,20);
h5write('myfile.h5', '/DS1', mydata);Write a hyperslab of data to the last 5-by-7 block of a data set.
h5create('myfile.h5','/DS2',[10 20]);
mydata = rand(5,7);
h5write('myfile.h5','/DS2',mydata,[6 14],[5 7]);Append data to an unlimited data set.
h5create('myfile.h5','/DS3',[20 Inf],'ChunkSize',[5 5]);
for j = 1:10
data = j*ones(20,1);
start = [1 j];
count = [20 1];
h5write('myfile.h5','/DS3',data,start,count);
end
h5disp('myfile.h5');
h5create | h5disp | h5read | h5writeatt

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |