This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Set netCDF fill mode


old_mode = netcdf.setFill(ncid,new_mode)


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 netCDF programming paradigm. See netcdf for more information.


This example creates a new file and specifies the fill mode used by netCDF with the file.

ncid ='','NC_WRITE');

% Set filling behavior
old_mode = netcdf.setFill(ncid,'NC_NOFILL');
Was this topic helpful?