h5create

Create HDF5 data set

Syntax

h5create(filename,datasetname,size,Name,Value)

Description

h5create(filename,datasetname,size,Name,Value) creates an HDF5 data set in the file specified by filename.

Input Arguments

filename

Text string specifying the name of an HDF5 file. If filename does not already exist, h5create creates it, with additional options specified by one or more Name,Value pair arguments.

datasetname

Text string specifying the name of the data set you want to create. If datasetname is a full path name, h5create creates all intermediate groups, if they don't already exist.

size

Array specifying the extents of the dataset. To specify an unlimited extent, set the corresponding element of size to Inf.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

'Datatype'

Any of the following MATLAB® datatypes.

doubleuint64uint32uint16uint8
singleint64int32int16int8

Default: double

'ChunkSize'

Defines chunking layout.

Default: Not chunked

'Deflate'

Defines gzip compression level (0-9).

Default: 0

'FillValue'

Defines the fill value for numeric data sets.

'Fletcher32'

Turns on the Fletcher32 checksum filter.

Default: false

'Shuffle'

Turns on the Shuffle filter.

Default: false

Examples

Create a fixed-size 100-by-200 data set.

h5create('myfile.h5','/myDataset1',[100 200]);
h5disp('myfile.h5');

Create a single-precision 1000-by-2000 data set with a chunk size of 50-by-80. Apply the highest level of compression.

 h5create('myfile.h5','/myDataset2',[1000 2000], 'Datatype','single', ...
          'ChunkSize',[50 80],'Deflate',9);
 h5disp('myfile.h5');

Create a two-dimensional data set that is unlimited along the second extent.

h5create('myfile.h5','/myDataset3',[200 Inf],'ChunkSize',[20 20]);
h5disp('myfile.h5');
Was this topic helpful?