Main Content

cdflib.setVarAllocBlockRecords

Specify range of records to be allocated for variable

Syntax

cdflib.setVarAllocBlockRecords(cdfId,varNum,firstrec,lastrec)

Description

cdflib.setVarAllocBlockRecords(cdfId,varNum,firstrec,lastrec) specifies a range of records you want to allocate (but not write) for a variable in a Common Data Format (CDF) file.

Input Arguments

cdfId

Identifier of a CDF file, returned by a call to cdflib.create or cdflib.open.

varNum

Numeric value identifying a variable in the file. Variable identifiers (variable numbers) are zero-based.

firstRec

Numeric value identifying the record at which to start allocating. Record numbers are zero-based.

lastRec

Numeric value identifying the record at which to stop allocating. Record numbers are zero-based.

Examples

Create a CDF, create a variable in the CDF, and then specify the number of records to allocate for the variable. To run this example, you must be in a writable folder.

cdfId = cdflib.create("your_file.cdf");

% Create a variable in the file
varNum = cdflib.createVar(cdfId,"Grades","cdf_int1",1,[],true,[]);

% Specify the number of records to allocate
cdflib.setVarAllocBlockRecords(cdfId,varNum,1,10)

%Clean up
cdflib.delete(cdfId)
clear cdfId

Tips

  • This function corresponds to the CDF library C API routine CDFsetzVarAllocBlockRecords.

  • To use this function, you must be familiar with the CDF C interface. You can access the CDF documentation at the CDF website.