Main Content

cdflib.getVarAllocRecords

Number of records allocated for variable

Syntax

numrecs = cdflib.getVarAllocRecords(cdfId, varNum)

Description

numrecs = cdflib.getVarAllocRecords(cdfId, varNum) returns the number of records allocated for a variable in a Common Data Format (CDF) file.

cdfId identifies the CDF file. varNum is a numeric value that identifies the variable. Variable numbers are zero-based.

Examples

Open example CDF and get the number of records allocated for a variable:

cdfId = cdflib.open("example.cdf");

% Find number of records allocated for first variable in the file
numrecs = cdflib.getVarAllocRecords(cdfId,0)
numrecs =

    64
%  Clean up
cdflib.close(cdfId)
clear cdfId

Tips

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

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