Main Content

matlab.io.hdfeos.gd.defDim

Namespace: matlab.io.hdfeos.gd

Define new dimension within grid

Syntax

defDim(gridID,dimname,dimlen)

Description

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

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

This function corresponds to the GDdefdim function in the HDF-EOS library C API.

Examples

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

import matlab.io.hdfeos.*
gfid = gd.open('myfile.hdf','create');
gridID = gd.create(gfid,'PolarGrid',100,100,[],[]);
gd.defDim(gridID,'Band',15);
gd.defDim(gridID,'Time',0);
gd.detach(gridID);
gd.close(gfid);