Main Content

matlab.io.hdf4.sd.isCoordVar

Namespace: matlab.io.hdf4.sd

Determine if dataset is a coordinate variable

Syntax

TF = isCoordVar(sdsID)

Description

TF = isCoordVar(sdsID) returns true if a dataset is a coordinate variable and returns false otherwise.

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

Examples

import matlab.io.hdf4.*
sdID = sd.start('sd.hdf');
ndataset = sd.fileInfo(sdID);
for idx = 0:ndataset-1
	sdsID = sd.select(sdID,idx);
	sdsName = sd.getInfo(sdsID);
	fprintf('%s (index %d) ', sdsName, idx);
	if ( sd.isCoordVar(sdsID) )
		fprintf('is a coordinate variable.\n');
	else
		fprintf('is not a coordinate variable.\n');
	end
	sd.endAccess(sdsID);
end
sd.close(sdID);

See Also