Main Content

netcdf.inqNcid

返回已命名组的 ID

语法

childGroupId = netcdf.inqNcid(ncid,childGroupName)

说明

childGroupId = netcdf.inqNcid(ncid,childGroupName) 返回 ncid 指定的文件或组中的名为 childGroupName 的子组的 ID。

输入参数

ncid

netcdf.createnetcdf.open 返回的 NetCDF 文件标识符,或者由 netcdf.defGrp 返回的 NetCDF 组标识符。

childGroupName

指定 NetCDF 组的名称的字符向量或字符串标量。

输出参数

childGroupID

NetCDF 组的标识符。

示例

本例打开 NetCDF 数据集并获取数据集中的组名。

ncid = netcdf.open('example.nc','nowrite');
gid = netcdf.inqNcid(ncid,'grid1');
netcdf.close(ncid);

参考

此函数对应于 netCDF 库 C API 中的 nc_inq_ncid 函数。