Main Content

Dimension Scale (H5DS)

Dimension scale associated with dataset dimensions

Description

Use the MATLAB® HDF5 dimension scale interface, H5DS, to access information about and manipulate HDF5 dimension scales.

An HDF5 dimension scale is an HDF5 dataset that is associated with the dimension of another dataset. A common case is a 2-dimensional array that has spatial information, such as latitude and longitude, associated with it.

Functions

H5DS.attach_scale

Attach dimension scale to specific dataset dimension

H5DS.attach_scale(dsID,dimscaleID,dim) attaches a dimension scale dimscaleID to the dimension dim of the dataset specified by dsID.

Note

The ordering of the dimension scale indices are the same as the HDF5 library C API. For more information see, Report Data Set Dimensions.

H5DS.detach_scale

Detach dimension scale from specific dataset dimension

H5DS.detach_scale(dsID,dimscaleID,dim) detaches dimension scale dimscaleID from the dimension dim of the dataset specified by dsID.

Note

The ordering of the dimension scale indices are the same as the HDF5 library C API. For more information see, Report Data Set Dimensions.

H5DS.get_label

Return label from specific dataset dimension

label = H5DS.get_label(dsID,dim) returns the label for dimension dim of the dataset specified by dsID.

Note

The ordering of the dimension scale indices are the same as the HDF5 library C API. For more information see, Report Data Set Dimensions.

H5DS.get_num_scales

Number of scales attached to dataset dimension

numscales = H5DS.get_num_scales(dsID,dim) determines the number of dimension scales that are attached to dimension dim of the dataset specified by dsID.

H5DS.get_scale_name

Name of dimension scale

dimscalename = H5DS.get_scale_name(dimscaleID) retrieves the name of the dimension scale dimscaleID.

H5DS.is_scale

Determine if dataset is a dimension scale

tf = H5DS.is_scale(dsID) determines whether the dataset specified by dsID is a dimension scale.

H5DS.iterate_scales

Iterate on scales attached to dataset dimension

[status,idxOut,opdataOut] = H5DS.iterate_scales(dsID,dim,idxIn,fnc,opdataIn) iterates over the scales attached to dimension dim of the dataset specified by dsID to perform a common operation whose function handle is fnc.

 Details

H5DS.set_label

Set label for dataset dimension

H5DS.set_label(dsID,dim,label) sets a label for dimension dim of the dataset specified by dsID.

Note

The ordering of the dimension scale indices are the same as the HDF5 library C API. For more information see, Report Data Set Dimensions.

H5DS.set_scale

Convert dataset to dimension scale

H5DS.set_scale(dsID,dimname) converts the dataset specified by dsID to a dimension scale with name dimname.

Examples

expand all

fid = H5F.open('example.h5');
world_dset_id = H5D.open(fid,'/g4/world');
label = H5DS.get_label(world_dset_id,0);
H5D.close(world_dset_id);
H5F.close(fid);
plist = 'H5P_DEFAULT';
srcFile = fullfile(matlabroot,'toolbox','matlab','demos','example.h5');
copyfile(srcFile,'myfile.h5');
fileattrib('myfile.h5','+w');
fid = H5F.open('myfile.h5','H5F_ACC_RDWR',plist);
world_dset_id = H5D.open(fid,'/g4/world',plist);
H5DS.set_label(world_dset_id,0,'latitude');
H5DS.set_label(world_dset_id,1,'longitude');
H5D.close(world_dset_id);
H5F.close(fid);
Introduced before R2006a