cdflib.setVarCacheSize
为变量指定多文件高速缓存缓冲区的数目
语法
cdflib.setVarCacheSize(cdfId,varNum,numBuffers)
说明
cdflib.setVarCacheSize(cdfId,varNum,numBuffers)
指定 CDF 库用于常用数据格式 (CDF) 文件中的变量的高速缓存缓冲区数。
此函数仅用于多文件格式 CDF 文件。它不适用于单文件格式 CDF 文件。有关高速缓存的详细信息,请参阅 CDF 用户指南。
输入参数
|
CDF 文件的标识符,通过调用 |
|
标识文件中的变量的数值。变量标识符(变量编号)从 0 开始。 |
|
标识要使用的高速缓存缓冲区的数目的数值。 |
示例
创建一个多文件 CDF 文件,然后检索用于变量的缓冲区的数目:
cdfId = cdflib.create("your_file.cdf"); % Set the format of the file to be multifile 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
% Increase the number of cache buffers used cdflib.setVarCacheSize(cdfId,varNum,5) % Check the number of cache buffers used with the variable numBuf = cdflib.getVarCacheSize(cdfId,varNum)
numBuf = 5
%Clean up cdflib.delete(cdfId) clear cdfId