ncwriteatt
Write attribute to NetCDF file
Syntax
ncwriteatt(filename,location,attname,attvalue)
ncwriteatt(filename,location,attname,attvalue,'Datatype',dtype)
Description
ncwriteatt(filename,location,attname,attvalue)
creates or modifies the
attribute specified by attname
in the group or variable specified by
location
, in the NetCDF file specified by
filename
. attvalue
can be a character vector,
string scalar, string array, or a numeric vector.
ncwriteatt(filename,location,attname,attvalue,'Datatype',dtype)
writes attvalue
as the data type specified in
dtype
. For example, specify the value of
'Datatype'
as 'string'
to write the data in
attvalue
as string data.
Input Arguments
|
Character vector or string scalar specifying the name of a NetCDF file |
|
Character vector or string scalar specifying a group or variable in the NetCDF file. To write
global attributes, set |
|
Character vector or string scalar specifying the name of an existing attribute in a NetCDF file or the name of the attribute that you want to create. |
|
Character vector, string scalar, string array, or a numeric vector. |
|
Character vector or string scalar specifying the data type to use to write
the attribute value |
Examples
Limitations
You can create attributes of type
NC_STRING
using NetCDF-4 files only.