This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Retrieve ID of parent group.


parentGroupID = netcdf.inqGrpParent(ncid)


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 netcdf.create or, or of a NetCDF group, returned by netcdf.defGrp.

Output Arguments


Identifier of the NetCDF group or file that is the parent of the specified file or group.


This example opens the NetCDF sample file and gets the full path of the parent of the specified group.

ncid ='','NOWRITE');
gid = netcdf.inqNcid(ncid,'grid2');
parentId = netcdf.inqGrpParent(gid);
fullName = netcdf.inqGrpNameFull(parentId);


This function corresponds to the nc_inq_grp_parent function in the NetCDF library C API.

For copyright information, read the netcdfcopyright.txt and mexnccopyright.txt files.

Was this topic helpful?