netcdf.create - Create new netCDF dataset
Syntax
ncid = netcdf.create(filename, mode)
[chunksize_out, ncid]=netcdf.create(filename,mode,initsz,chunksize)
Description
ncid = netcdf.create(filename, mode) creates
a new netCDF file according to the file creation mode. The return
value, ncid, is a file ID. The type of access is
described by the mode parameter, which can have any of the following
values.
| Value | Description |
| 'NC_NOCLOBBER' | Prevent overwriting of existing file with the same name. |
| 'NC_SHARE' | Allow synchronous file updates. |
| 'NC_64BIT_OFFSET' | Allow easier creation of files and variables which are larger
than two gigabytes. |
Note
You can specify the mode as a numeric value, retrieved using
the netcdf.getConstant function. To specify more
than one mode, use a bitwise-OR of the numeric values of the modes. |
[chunksize_out, ncid]=netcdf.create(filename,mode,initsz,chunksize) creates
a new netCDF file, but with additional performance tuning parameters. initsz sets
the initial size of the file. chunksize can affect
I/O performance. The actual value chosen by the netCDF library might
not correspond to the input value.
This function corresponds to the nc_create and nc__create functions
in the netCDF library C API. To use this function, you should be familiar
with the information about netCDF contained in the NetCDF
C Interface Guide for version 3.6.2.
Examples
This example creates a netCDF dataset named foo.nc,
only if no other file with the same name exists in the current directory.
To run this example, you must have write permission in your current
directory.
ncid = netcdf.create('foo.nc','NC_NOCLOBBER');
See Also
netcdf.getConstant, netcdf.open
 | netcdf.copyAtt | | netcdf.defDim |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit