Main Content

matlab.io.hdfeos.sw.nEntries

Namespace: matlab.io.hdfeos.sw

Number of entries for specific type

Syntax

nEnts = nEntries(swathID,type)

Description

nEnts = nEntries(swathID,type) returns the number of entries in a swath. Valid inputs for type include:

'dims'or 'HDFE_NENTDIM'
'maps'or 'HDFE_NENTMAP'
'imaps'or 'HDFE_NENTIMAP'
'geofields'or 'HDFE_NENTGFLD'
'datafields'or 'HDFE_NENTFLD'

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

Examples

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);
ndims = sw.nEntries(swathID,'dims');
sw.detach(swathID);
sw.close(swfid);