Documentation

netcdf.defGrp

Create group in NetCDF file

Syntax

childGrpID = netcdf.defGrp(parentGroupId,childGroupName)

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

Input Arguments

parentGroupId

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

childGroupName

Text string specifying the name that you want to assign to the group.

Output Arguments

childGrpID

Identifier of a NetCDF group.

Examples

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);

References

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

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

Was this topic helpful?