Main Content

netcdf.inqNcid

Return ID of group

    Description

    gid = netcdf.inqNcid(ncid,gname) returns the ID of the group specified by gname in the file or group specified by ncid.

    example

    Examples

    collapse all

    Open the sample netCDF file, and get the ID of a group.

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

    Close the netCDF file.

    netcdf.close(ncid)
    

    Input Arguments

    collapse all

    NetCDF file or group identifier, specified as a nonnegative integer scalar. You can use the netcdf.create or netcdf.open function to return a file identifier. You can use the netcdf.defGrp function to return a group identifier.

    Data Types: double

    NetCDF group name, specified as a string scalar or character vector.

    Tips

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

    Version History

    Introduced in R2010b