netcdf.putAtt(ncid, varid, attname, attvalue)
| Parameter | Description |
|---|---|
| ncid | Open netCDF file or group identifier. |
| varid | Variable identifier, or NC_GLOBAL for a global attribute. |
| attname | Attribute name. |
| attvalue | Attribute value. |
| Parameter | Description |
|---|---|
| none | This function does not return a value. |
netcdf.putAtt exposes low-level attribute operations.
Attributes store metadata such as units, titles, comments, scale factors, and valid ranges.
filename = [tempdir(), 'help_netcdf_putAtt.nc'];
ncid = netcdf.create(filename, netcdf.getConstant('NC_CLOBBER'));
netcdf.putAtt(ncid, netcdf.getConstant('NC_GLOBAL'), 'title', 'sample file');
netcdf.close(ncid);
| Version | Description |
|---|---|
| 2.0.0 | initial version |