addVariable
add a new (real or complex) variable to the file
Declaration
variable = addVariable(name,data,dimNames,properties,ncType)
Parameters
name
name of the variable (a string)data
variable datadimNames
cell array containing the dimension namesproperties
(optional)containers.Map
properties
ncType
Returns
variable
a NetCDFVariable object
Discussion
Immediately initializes and writes the given variable data to file.
ncfile.addVariable('fluid-tracer',myVariableData, {'x','y','t'},containers.Map({'isTracer'},{'1'}),'NC_DOUBLE');