Main Content

netcdf.defGrp

Create group in netCDF file

Description

childGrpID = netcdf.defGrp(parentGroupId,childGroupName) creates a child group with the name specified by childGroupName, that is the child of the parent group specified by parentGroupId.

Note

This function corresponds to the nc_def_grp function in the netCDF library C API.

example

Examples

collapse all

This example creates a netCDF dataset and then defines a group.

ncid = netcdf.create("myfile.nc","netcdf4");
childGroupId = netcdf.defGrp(ncid,"mygroup");
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

Child group name that you want to assign, specified as a string scalar or a character vector.

Data Types: string | char

Output Arguments

collapse all

Identifier of a netCDF group, returned as an integer.

Data Types: double

Version History

Introduced in R2010b