%% Create NetCDF File Without Overwriting Existing File
% Create 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','NOCLOBBER')

% netcdf.create returns a file identifier.
%
% Close the file

netcdf.close(ncid)

% Copyright 2015 The MathWorks, Inc.