Categories &

Functions List

Function Reference: h5write

Function File: h5write (filename, dsetname, data)
Function File: h5write (filename, dsetname, data, start, count)
Function File: h5write (filename, dsetname, data, start, count, stride)

Write data to a HDF5 dataset.

h5write(filename,dsetname,data) writes data to an entire dataset, dsetname, in the specified HDF5 file. If the dataset is fixed in size, the amount of data to be written must match the size of the dataset.

h5write(filename,ds,data,start,count) writes a subset of data to a dataset, beginning at starting location start, and continuing for count elements. In a multidimensional dataset, count specifies a distance in each direction. h5write extends an extendable dataset along any unlimited dimensions, if necessary.

h5write(filename,ds,data,start,count,stride) specifies the spacing between elements, stride, along each dimension of the dataset.

filename

Filename of an existing HDF5 file, specified as a string

dsetname

The full path to an existing dataset, specified as a string.

data

Data to be written to the HDF5 file. If a numeric datatype was specified in the corresponding call to h5create, then data is a numeric matrix containing floating-point or integer data. Data must be non sparse, and must be the same size as the HDF5 dataset if you do not specify start or count. If a dimension in the dataset is unlimited, then the data to be written can be any size along that dimension.

If "string" was specified as the datatype in the corresponding call to h5create, data is either a single string or a cell string array. The array dimensions must match those specified in the call to h5create.

start

Starting location, specified as a numeric vector of positive integers. For an n-dimensional dataset, start is a vector of length n containing 1-based indices. The elements of start correspond, in order, to the dataset dimensions. If any dimension of ds is unlimited, you must specify start.

If you do not specify start, then the h5write function starts writing to the dataset from the first index along each dimension.

count

Number of elements to write, specified as a numeric vector of positive integers. For an n-dimensional dataset, count is a vector of length n, specifying the number of elements to write to the dataset along each dimension. If any dimension of ds is unlimited, then count must be specified.

stride

Optional spacing between elements along each dimension. For an n-dimensional dataset, stride is a vector of length n. A value of 1 writes without skipping elements in the corresponding dimension, a value of 2 writes every other element, and so on.

See also: h5create

Source Code: h5write