netcdf.defVarFill
Define fill parameters for NetCDF variable
Syntax
netcdf.defVarFill(ncid,varid,noFillMode,fillValue)
Description
netcdf.defVarFill(ncid,varid,noFillMode,fillValue)
sets
the fill parameters for a variable in a NetCDF-4 file. varid
identifies
the variable and the ncid
identifies the NetCDF-4
file.
For netCDF files, you can only specify fill values when the
NetCDF is in definition mode (before calling netcdf.endDef
).
For NetCDF files in classic and 64-bit offset modes, you can turn
no-fill mode on and off at any time.
Input Arguments
|
Identifier of a NetCDF-4 file, returned by |
|
Identifier of a NetCDF variable, returned by |
|
Boolean value. When set to |
|
Specifies the value to use in the variable when no other value is specified. The data type must be the same data type as the variable. |
Examples
This example creates a NetCDF-4 file and defines a fill value for a variable.
ncid = netcdf.create('myfile.nc','NETCDF4'); dimid = netcdf.defDim(ncid,'latitude',180); varid = netcdf.defVar(ncid,'latitude','double',dimid); netcdf.defVarFill(ncid,varid,false,-999); netcdf.close(ncid);
Limitations
You cannot specify
noFillMode
astrue
when writing data of typeNC_STRING
to NetCDF-4 files.
References
This function corresponds to the nc_def_var_fill
function
in the NetCDF library C API.