Main Content

netcdf.inqDimIDs

Return list of dimension identifiers in group

Description

example

dimIDs = netcdf.inqDimIDs(ncid) returns a list of dimension identifiers in the group specified by ncid.

dimIDs = netcdf.inqDimIDs(ncid,includeParents) includes all dimensions in all parent groups if includeParents is true.

Examples

collapse all

This example opens the netCDF sample file, gets the IDs of all dimensions associated with the grid1 group, and then gets the IDs of all dimensions of the same group and its parent groups.

ncid = netcdf.open("example.nc","NOWRITE");
gid = netcdf.inqNcid(ncid,"grid1");
dimids = netcdf.inqDimIDs(gid)
dimids =

     3     4     5
dimids_all = netcdf.inqDimIDs(gid,true)
dimids_all =

     0     1     2     3     4     5
netcdf.close(ncid)

Input Arguments

collapse all

Identifier of a netCDF file, returned by netcdf.create or netcdf.open, or of a netCDF group, returned by netcdf.defGrp, specified as a nonnegative integer scalar.

Data Types: double

Include all dimensions of all parent groups filter, specified as one of the following values.

  • If set to true, netcdf.inqDimIDs includes the dimensions of all parent groups.

  • If set to false, netcdf.inqDimIDs does not include the dimensions of all parent groups.

Data Types: logical

Tips

  • This function corresponds to the nc_inq_dimids function in the netCDF library C API.

Version History

Introduced in R2010b