netcdf.putVar
Write data to netCDF variable
Syntax
netcdf.putVar(ncid,varid,data)
netcdf.putVar(ncid,varid,start,data)
netcdf.putVar(ncid,varid,start,count,data)
netcdf.putVar(ncid,varid,start,count,stride,data)
Description
netcdf.putVar(ncid,varid,data)
writes data
to a netCDF
variable identified by varid
.
Note
For variables of type
NC_CHAR
,
vardata
must contain only
ASCII-encoded characters. NetCDF-4 files support
writing UTF-8 -encoded characters in variables of
type NC_STRING
.
ncid
is a netCDF file identifier returned
by netcdf.create
or netcdf.open
.
netcdf.putVar(ncid,varid,start,data)
writes
a single data value into the variable at the index specified by start
.
netcdf.putVar(ncid,varid,start,count,data)
writes
a section of values into the netCDF variable at the index specified
by the vector start
to the extent specified by
the vector count
, along each dimension of the specified
variable.
netcdf.putVar(ncid,varid,start,count,stride,data)
writes
the subsection specified by sampling interval, stride
,
of the values in the section of the variable beginning at the index start
and
to the extent specified by count
.
This function corresponds to several variable I/O functions in the netCDF library C API. To use this function, you should be familiar with the netCDF programming paradigm.