netcdf.inqGrpParent
Retrieve ID of parent group
Syntax
parentGroupID = netcdf.inqGrpParent(ncid)
Description
parentGroupID = netcdf.inqGrpParent(ncid)
returns
the ID of the parent group given the location of the child group,
specified by ncid
.
Input Arguments
|
Identifier of a NetCDF file, returned by |
Output Arguments
|
Identifier of the NetCDF group or file that is the parent of the specified file or group. |
Examples
This example opens the NetCDF sample file and gets the full path of the parent of the specified group.
ncid = netcdf.open('example.nc','NOWRITE'); gid = netcdf.inqNcid(ncid,'grid2'); parentId = netcdf.inqGrpParent(gid); fullName = netcdf.inqGrpNameFull(parentId); netcdf.close(ncid);
References
This function corresponds to the nc_inq_grp_parent
function
in the NetCDF library C API.