Main Content


Retrieve name of group


    groupName = netcdf.inqGrpName(ncid) returns the name of a group specified by ncid.


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


    Obtain Group Names from a NetCDF File

    This example opens the NetCDF sample file and gets the names of groups in the dataset.

     ncid ="",'NOWRITE');
     name = netcdf.inqGrpName(ncid);

    Input Arguments

    collapse all

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

    Data Types: double

    Output Arguments

    collapse all

    The name of the group specified by ncid, returned as a character vector. The root group has the name '/'.

    Data Types: char

    Version History

    Introduced in R2010b