netcdf.defVarFletcher32

Define checksum parameters for NetCDF variable

Syntax

netcdf.defVarFletcher32(ncid,varid,setting)

Description

netcdf.defVarFletcher32(ncid,varid,setting) defines the checksum settings for the NetCDF variable specified by varid in the file specified by ncid.

Input Arguments

ncid

Identifier of NetCDF file, returned by netcdf.create or netcdf.open, or of a NetCDF group, returned by netcdf.defGrp.

varid

Identifier of a NetCDF variable, returned by netcdf.defVar.

setting

Character vector or string scalar specifying whether Fletcher32 checksum error detection is used with the variable. To turn on Fletcher32 checksum, specify the value 'FLETCHER32'. To turn off the use of checksum error detection, specify the value 'NOCHECKSUM'.

Examples

This example creates a NetCDF dataset and turns on the Fletcher32 checksum for a variable.

ncid = netcdf.create('myfile.nc','NETCDF4');
latdimid = netcdf.defDim(ncid,'lat',1800);
londimid = netcdf.defDim(ncid,'col',3600);
varid = netcdf.defVar(ncid,'earthgrid','double',[latdimid londimid]);
netcdf.defVarFletcher32(ncid,varid,'FLETCHER32');
netcdf.close(ncid);

References

This function corresponds to the nc_def_var_fletcher32 function in the NetCDF library C API.

For copyright information, read the files netcdfcopyright.txt and mexnccopyright.txt.