addDimension
Adds a both a new dimension and its associated coordinate variable to the NetCDF file.
Declaration
[dimension,variable] = addDimension(name,data,properties,dimLength)
Parameters
name
string with the name of the dimensiondata
array of values along that dimension, or emptyproperties
containers.Map containing any key-value pairs to be associated with the dimension.dimLength
(optional) length of the dimension
Returns
dimension
a NetCDFDimension object with the newly create dimensionvariable
a NetCDFVariable object with the associated coordinate variable
Discussion
Usage
x = linspace(0,10,11);
ncfile.addDimension('x',x,[]);