netcdf.putAtt
Write data to netCDF attribute
Description
netcdf.putAtt(
writes the attribute named ncid
,varid
,attname
,attvalue
)attname
with value
attvalue
to the netCDF variable identified by
varid
in the netCDF file or group specified by
ncid
. The written attribute value is of the netCDF data type that
best matches the MATLAB® data type of attvalue
. For more information about how
MATLAB determines the best match, see MATLAB to NetCDF Data Type Conversion.
Examples
Input Arguments
More About
Tips
You cannot use
netcdf.putAtt
to set the_FillValue
attribute of variables in netCDF-4 files. Use thenetcdf.defVarFill
function to set the fill value for a variable.This function corresponds to several (
nc_put_att_*
) functions in the netCDF library C API.To use this function, you must be familiar with the netCDF C interface. You can access the netCDF documentation at the netCDF website.