Categories &

Functions List

Function Reference: h5create

Function File: h5create (filename, dsetname, size)
Function File: h5create (filename, dsetname, size, key, val,...)

Create a HDF5 dataset.

h5create (filename, dsetname, size) creates a dataset with name dsetname and size size in the HDF5 file specified by filename.

h5create (filename, dsetname, size, key, val,...) specifies one or more key-value arguments.

Input arguments:

filename

The path of the HDF5 file as a string. If the file does not exist it will be created.

dsetname

A string specifying the complete path to the dataset starting from the root group "/". Intermediate groups are created as necessary.

size

A vector specifying the dimensions of the dataset. size may contain one or several Inf values. This will lead to unlimited maximum extent of the dataset in the respective dimensions and 0 initial extent. Datasets with at least one unlimited dimension must be chunked. Chunking is generally recommended for large datasets.

size==1 or size==[1 1] results in a scalar (0-dimensional) dataset.

Note that due to the difference in array storage layout between OCTAVE (column-major) and HDF5 (row-major), arrays are saved transposed in the HDF5 file. Thus, if a hdf5oct-generated file is opened by another application the arrays will appear transposed.

The list of key, val arguments allows to specify certain properties of the dataset. Allowed settings are:

Datatype

one of the strings: ‘double’(default) | ‘single’ | ‘uint64’ | ‘uint32’ | ‘uint16’ | ‘uint8’ | ‘int64’ | ‘int32’ | ‘int16’ | ‘int8’ | ’string’

ChunkSize

The value may be either a vector specifying the chunk size, or an empty vector [], which means no chunking (this is the default).

See also: h5write

Source Code: h5create