Main Content

netcdf.inqGrpParent

Return ID of parent group

    Description

    parentGroupID = netcdf.inqGrpParent(ncid) returns the ID of the parent group given the location of the child group, specified by ncid.

    example

    Examples

    collapse all

    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);
    

    Input Arguments

    collapse all

    Identifier of netCDF file, returned by netcdf.create function or netcdf.open function, or of a netCDF group, returned by netcdf.defGrp function.

    Data Types: double

    Output Arguments

    collapse all

    Identifier of the netCDF group or file that is the parent of the specified file or group, returned as an integer.

    Data Types: double

    Version History

    Introduced in R2010b