matlab.io.hdf4.sd.create
Package: matlab.io.hdf4.sd
Create new data set
Syntax
sdsID = create(sdID,name,datatype,dims)
Description
sdsID = create(sdID,name,datatype,dims)
creates
a data set with the given name name
, data type datatype
,
and dimension sizes dims
.
To create a data set with an unlimited dimension, the last value in dims
should be set to 0.
This function corresponds to the SDcreate
function
in the HDF library C API, but because MATLAB® uses FORTRAN-style
ordering, the dims
parameter is reversed with respect
to the C library API.
Examples
Create a 3D data set with an unlimited dimension.
import matlab.io.hdf4.* sdID = sd.start('myfile.hdf','create'); sdsID = sd.create(sdID,'temperature','double',[10 20 0]); sd.endAccess(sdsID); sd.close(sdID);