Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

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

Character vector 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

Character vector 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

TextEncoding

Character encoding, specified as 'system' or 'UTF-8'.

  • 'system' — Use the system default encoding to create the dataset name.

  • 'UTF-8' — Use UTF-8 encoding to create the dataset name.

Default: 'system'

Examples

collapse all

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

h5create('myfile.h5','/myDataset1',[100 200])
h5disp('myfile.h5')
HDF5 myfile.h5 
Group '/' 
    Dataset 'myDataset1' 
        Size:  100x200
        MaxSize:  100x200
        Datatype:   H5T_IEEE_F64LE (double)
        ChunkSize:  []
        Filters:  none
        FillValue:  0.000000

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')
HDF5 myfile.h5 
Group '/' 
    Dataset 'myDataset2' 
        Size:  1000x2000
        MaxSize:  1000x2000
        Datatype:   H5T_IEEE_F32LE (single)
        ChunkSize:  50x80
        Filters:  deflate(9)
        FillValue:  0.000000

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')
HDF5 myfile.h5 
Group '/' 
    Dataset 'myDataset3' 
        Size:  200x0
        MaxSize:  200xInf
        Datatype:   H5T_IEEE_F64LE (double)
        ChunkSize:  20x20
        Filters:  none
        FillValue:  0.000000

Introduced in R2011a

Was this topic helpful?