matlab.io.hdf4.sd.setDimStrs
Namespace: matlab.io.hdf4.sd
Set label, unit, and format attributes
Syntax
setDimStrs(dimID,label,unit,format)
Description
setDimStrs(dimID,label,unit,format) sets
the label, unit, and format attributes for the dimension identified
by dimID.
This function corresponds to the SDsetdimstrs function
in the HDF library C API.
Examples
import matlab.io.hdf4.* sdID = sd.start('myfile.hdf','create'); sdsID = sd.create(sdID,'temperature','double',[10 20]); dimID = sd.getDimID(sdsID,0); sd.setDimName(dimID,'lat'); dimID = sd.getDimID(sdsID,1); sd.setDimName(dimID,'lon'); sd.setDimStrs(dimID,'Degrees of Longitude','degrees_east','%.2f'); sd.endAccess(sdsID); sd.close(sdID);