Main Content

cdflib.getVarCacheSize

多文件高速缓存缓冲区的数目

语法

numBuffers = cdflib.getVarCacheSize(cdfId,varNum)

说明

numBuffers = cdflib.getVarCacheSize(cdfId,varNum) 返回用于常用数据格式 (CDF) 文件中的变量的高速缓存缓冲区数。

cdfId 标识 CDF 文件。varNum 是标识变量的数值。变量标识符从 0 开始。

此函数仅适用于多文件格式 CDF 文件。有关高速缓存的详细信息,请参阅 CDF 用户指南

示例

创建多文件 CDF 文件并检索用于变量的缓冲区的数目。要运行此示例,当前必须位于可写文件夹中。

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
% Clean up
cdflib.delete(cdfId)
clear cdfId

参考

此函数对应于 CDF 库的 C API 例程 CDFgetzVarCacheSize

要使用此函数,必须熟悉 CDF C 接口。您可以在 CDF 网站上访问 CDF 文档。