Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

netcdf.setFill - Set netCDF fill mode

Syntax

old_mode = netcdf.setFill(ncid,new_mode)

Description

old_mode = netcdf.setFill(ncid,new_mode) sets the fill mode for a netCDF file identified by ncid.

new_mode can be either 'FILL' or 'NOFILL' or their numeric equivalents, as retrieved by netcdf.getConstant. The default mode is 'FILL'. netCDF pre-fills data with fill values. Specifying 'NOFILL' can be used to enhance performance, because it avoids the duplicate writes that occur when the netCDF writes fill values that are later overwritten with data.

This function corresponds to the nc_set_fill 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 file and specifies the fill mode used by netCDF with the file.

ncid = netcdf.open('foo.nc','NC_WRITE');

% Set filling behavior
old_mode = netcdf.setFill(ncid,'NC_NOFILL');

See Also

netcdf.getConstant

  


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