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:
The path of the HDF5 file as a string. If the file does not exist it will be created.
A string specifying the complete path to the dataset starting from the root group "/". Intermediate groups are created as necessary.
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:
one of the strings: ‘double’ (default) | ‘single’ | ‘double complex’ | ‘single complex’ | ‘uint64’ | ‘uint32’ | ‘uint16’ | ‘uint8’ | ‘int64’ | ‘int32’ | ‘int16’ | ‘int8’ | ‘logical’ | ‘string’
The ‘complex’ and ‘logical’ datatypes are not supported in the MATLAB high-level HDF5 interface.
hdf5oct
supports these types in compatibility with h5py
:
- the ‘complex’ types are mapped to compound HDF5 datatypes with 2 members, ‘r’ and ‘i’, for real and imaginary part, respectively.
- the ‘logical’ type is mapped to a HDF5 Enum: (FALSE = 0, TRUE = 1)
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