Documentation Center

  • Trial Software
  • Product Updates

cdflib.setVarsCacheSize

Specify number of cache buffers used for all variables

Syntax

cdflib.setVarsCacheSize(cdfId,varNum,numBuffers)

Description

cdflib.setVarsCacheSize(cdfId,varNum,numBuffers) specifies the number of cache buffers the CDF library uses for all the variables in the multifile format Common Data Format (CDF) file.

This function is not applicable to single-file CDFs. For more information about caching, see the CDF User's Guide.

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.

numBuffers

Numeric value specifying the cache buffers.

Examples

Create a multifile CDF and specify the number of buffers used for all variables. To run this example, you must be in a writable folder.

cdfid = cdflib.create('your_file.cdf')

% Set the format of the file to be multi-file
cdflib.setFormat(cdfid,'MULTI_FILE');

% Create a variable in the file
varNum = cdflib.createVar(cdfid,'Time','cdf_int1',1,[],true,[]);

% Note how the library creates a separate file for the variable
ls your_file.*

your_file.cdf  your_file.z0  

% Determine the number of cache buffers used with the variable
numBuf = cdflib.getVarCacheSize(cdfid,varNum)

numBuf =

     1

% Specify the number of cache buffers used by all variables in CDF.
cdflib.setVarsCacheSize(cdfid,6)

% Check the number of cache buffers used with the variable.
numBuf = cdflib.getVarCacheSize(cdfid,varNum)

numBuf =

     6

%  Clean up
cdflib.delete(cdfid);

clear cdfid

References

This function corresponds to the CDF library C API routine CDFsetzVarsCacheSize.

To use this function, you must be familiar with the CDF C interface. Read the CDF documentation at the CDF Web site.

For copyright information, see the cdfcopyright.txt file.

See Also

|

Tutorials

Was this topic helpful?