Dataspace (H5S)
Dimensionality of dataset
Description
Use the MATLAB® HDF5 dataspace interface, H5S
, to create and handle
dataspaces, and access information about them.
An HDF5 dataspace defines the size and shape of the dataset or attribute raw data, and must be defined when the dataset or attribute is created.
Functions
H5S.close
Close dataspace
H5S.close(spaceID)
releases and terminates access to the dataspace
identifier spaceID
.
H5S.copy
Create copy of dataspace
output = H5S.copy(spaceID)
creates an identical copy of the dataspace
identified by spaceID
.
H5S.create
Create new dataspace
spaceID = H5S.create(spacetype)
creates a new dataspace identifier of
type spacetype
.
H5S.create_simple
Create new simple dataspace
spaceID = H5S.create_simple(rank,dims,maxdims)
creates a new simple
dataspace and opens it for access.
H5S.extent_copy
Copy extent from source to destination dataspace
H5S.extent_copy(destID,srcID)
copies the extent from a source
dataspace srcID
to the destination dataspace
destID
.
H5S.get_regular_hyperslab
Retrieve a regular hyperslab selection
[start,stride,count,block] = H5S.get_regular_hyperslab(spaceID)
retrieves a regular hyperslab selection.
H5S.get_select_bounds
Bounding box of dataspace selection
[start,finish] = H5S.get_select_bounds(spaceID)
returns the
coordinates of the bounding box containing the current selection.
H5S.get_select_elem_npoints
Number of element points in selection
numpoints = H5S.get_select_elem_npoints(spaceID)
returns the number
of element points in the current dataspace selection.
H5S.get_select_elem_pointlist
Element points in dataspace selection
points = H5S.get_select_elem_pointlist(spaceID,start,numpoints)
returns the list of element points in the current dataspace selection.
H5S.get_select_hyper_blocklist
List of hyperslab blocks
blocklist = H5S.get_select_hyper_blocklist(spaceID,start,numblocks)
returns a list of the hyperslab blocks currently selected.
H5S.get_select_hyper_nblocks
Number of hyperslab blocks
numblocks = H5S.get_select_hyper_nblocks(spaceID)
returns the number
of hyperslab blocks in the current dataspace selection.
H5S.get_select_npoints
Number of elements in dataspace selection
numpoints = H5S.get_select_npoints(spaceID)
returns the number of
elements in the current dataspace selection.
H5S.get_select_type
Type of dataspace selection
selection = H5S.get_select_type(spaceID)
returns the selection
type.
H5S.get_simple_extent_dims
Dataspace size and maximum size
[numdims,dimsize,maxdims] = H5S.get_simple_extent_dims(spaceID)
returns the number of dimensions in the dataspace, the size of each dimension, and the
maximum size of each dimension.
H5S.get_simple_extent_ndims
Dataspace rank
output = H5S.get_simple_extent_ndims(spaceID)
returns the
dimensionality, also known as the rank, of a dataspace.
H5S.get_simple_extent_npoints
Number of elements in dataspace
output = H5S.get_simple_extent_npoints(spaceID)
returns the number of
elements in the dataspace specified by spaceID
.
H5S.get_simple_extent_type
Dataspace class
spacetype = H5S.get_simple_extent_type(spaceID)
returns the class of
the dataspace specified by spaceID
.
H5S.is_regular_hyperslab
Determine whether a hyperslab selection is regular
output = H5S.is_regular_hyperslab(spaceID)
returns a positive value
if the hyperslab selection associated with spaceID
is regular, and
0
if it is not.
H5S.is_simple
Determine if dataspace is simple
output = H5S.is_simple(spaceID)
returns a positive value if the
dataspace specified by spaceID
is a simple dataspace, and
0
if it is not.
H5S.offset_simple
Set offset of simple dataspace
H5S.offset_simple(spaceID,offset)
specifies the offset of the simple
dataspace specified by spaceID
. This function allows the same shaped
selection to be moved to different locations within a dataspace without requiring it to be
redefined.
H5S.select_all
Select entire extent of dataspace
H5S.select_all(spaceID)
selects the entire extent of the dataspace
specified by spaceID
.
H5S.select_elements
Specify coordinates to include in selection
H5S.select_elements(spaceID,op,coord)
selects array elements to
include in the selection for the dataspace specified by spaceID
.
H5S.select_hyperslab
Select hyperslab region
H5S.select_hyperslab(spaceID,op,start,stride,count,block)
selects a
hyperslab region to add to the current selected region for the dataspace specified by
spaceID
.
H5S.select_none
Reset selection region to include no elements
H5S.select_none(spaceID)
resets the selection region for the
dataspace spaceID
to include no elements.
H5S.select_valid
Determine validity of selection
tf = H5S.select_valid(spaceID)
returns a positive value if the
selection of the dataspace specified by spaceID
is within the extent of
that dataspace, and 0
if it is not. A negative return value indicates a
failure.
H5S.set_extent_none
Remove extent from dataspace
H5S.set_extent_none(spaceID)
removes the extent from a dataspace and
sets the type to H5S_NO_CLASS
.
H5S.set_extent_simple
Set size of dataspace
H5S.set_extent_simple(spaceID,rank,dims,maxdims)
sets the size of the
dataspace identified by spaceID
.
Examples
Version History
Introduced before R2006aSee Also
Datatype (H5T)
| Dataset (H5D)
| Dimension Scale
(H5DS)
| MATLAB (H5ML)