Main Content

matlab.io.hdfeos.sw.defDim

Namespace: matlab.io.hdfeos.sw

Define new dimension within swath

Syntax

defDim(swathID,dimname,dimlen)

Description

defDim(swathID,dimname,dimlen) defines a new dimension named dimname with length dimlen in the swath structure identified by swathID.

To specify an unlimited dimension, use either 0 or 'unlimited' for dimlen.

This function corresponds to the SWdefdim function in the HDF-EOS library.

Examples

Define a dimension 'Band' with length of 15 and an unlimited dimension 'Time'.

import matlab.io.hdfeos.*
swfid = sw.open('myfile.hdf','create');
swathID = sw.create(swfid,'MySwath');
sw.defDim(swathID,'GeoTrack',2000);
sw.defDim(swathID,'GeoXtrack',1000);
sw.defDim(swathID,'DataTrack',4000);
sw.defDim(swathID,'DataXtrack',2000);
sw.detach(swathID);
sw.close(swfid);

See Also