Main Content

matlab.io.hdf4.sd.getDimScale

Namespace: matlab.io.hdf4.sd

Scale data for dimension

Syntax

scale = getDimScale(dimID)

Description

scale = getDimScale(dimID) returns the scale values of the dimension identified by dimID.

This function corresponds to the SDgetdimscale function in the HDF library C API.

Examples

import matlab.io.hdf4.*
sdID = sd.start('myfile.hdf','create');
sdsID = sd.create(sdID,'temperature','double',20);
dimID = sd.getDimID(sdsID,0);
sd.setDimName(dimID,'x');
sd.setDimScale(dimID,0:5:95);
sd.endAccess(sdsID);
sd.close(sdID);
sdID = sd.start('myfile.hdf');
idx = sd.nameToIndex(sdID,'temperature');
sdsID = sd.select(sdID,idx);
dimID = sd.getDimID(sdsID,0);
scale = sd.getDimScale(dimID);
sd.endAccess(sdsID);
sd.close(sdID);