Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

netcdf.sync - Synchronize netCDF file to disk

Syntax

netcdf.sync(ncid)

Description

netcdf.sync(ncid) synchronizes the state of a netCDF file to disk. The netCDF library normally buffers accesses to the underlying netCDF file, unless you specify the NC_SHARE mode when you opened the file with netcdf.open or netcdf.create. To call netcdf.sync, the netCDF file must be in data mode.

This function corresponds to the nc_sync function 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 new netCDF file for write access, performs an operation on the file, takes the file out of define mode, and then synchronizes the file to disk.

% Create a netCDF file.
ncid = netcdf.create('foo.nc','NC_WRITE');

% Perform an operation.
dimid = netcdf.defDim(ncid,'Xdim',50);

% Take file out of define mode.
netcdf.endDef(ncid);

% Synchronize the file to disk.
netcdf.sync(ncid) 

See Also

netcdf.close, netcdf.create, netcdf.open, netcdf.endDef

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS