Main Content

netcdf.defVarFletcher32

Define checksum parameters for netCDF variable

Description

netcdf.defVarFletcher32(ncid,varid,checksumSetting) defines the checksum settings for the netCDF-4 variable specified by varid in the file specified by ncid.

example

Examples

collapse all

This example creates a netCDF-4 file 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,"lon",3600);
varid = netcdf.defVar(ncid,"earthgrid","double",[latdimid londimid]);
netcdf.defVarFletcher32(ncid,varid,"FLETCHER32");
netcdf.close(ncid);

Input Arguments

collapse all

Identifier of a netCDF file, returned by netcdf.create or netcdf.open, or of a netCDF group, returned by netcdf.defGrp, specified as a nonnegative integer scalar.

Data Types: double

Identifier of netCDF variable, returned by netcdf.defVar, specified as a nonnegative integer scalar.

Data Types: double

Fletcher32 checksum setting type of the netCDF variable, specified as one of these values.

  • "FLETCHER32"— Enable Fletcher32 checksum error detection for the variable.

  • "NOCHECKSUM"— Disable Fletcher32 checksum error detection for the variable.

Data Types: char | string

Tips

  • This function corresponds to the nc_def_var_fletcher32 function in the netCDF library C API.

Version History

Introduced in R2010b