Function File: nccreate(filename,varname)
Function File: nccreate(filename,varname,"property",value,...)

Create the variable varname in the file filename.

Properties

The following properties can be used:

  • "Dimensions": a cell array with the dimension names followed by their length or Inf if the dimension is unlimited. If the property is omitted, a scalar variable is created.
  • "Datatype": a string with the Octave data type name (see ncinfo for the correspondence between Octave and NetCDF data types). The default data type is a "double".
  • "Format": This can be "netcdf4_classic" (default), "classic", "64bit" or "netcdf4".
  • "FillValue": the value used for undefined elements of the NetCDF variable.
  • "ChunkSize": the size of the data chunks. If omitted, the variable is not chunked.
  • "DeflateLevel": The deflate level for compression. It can be the string "disable" (default) for no compression or an integer between 0 (no compression) and 9 (maximum compression).
  • "Shuffle": true for enabling the shuffle filter or false (default) for disabling it.

Example

nccreate("test.nc","temp","Dimensions",{"lon",10,"lat",20},"Format","classic");
ncdisp("test.nc");

See also: ncwrite.

Package: netcdf