Main Content

cdflib.setVarCacheSize

변수에 대한 다중 파일(Multifile) 캐시 버퍼의 수 지정

구문

cdflib.setVarCacheSize(cdfId,varNum,numBuffers)

설명

cdflib.setVarCacheSize(cdfId,varNum,numBuffers)는 CDF(Common Data Format) 파일의 변수에 대해 CDF 라이브러리가 사용하는 캐시 버퍼의 수를 지정합니다.

이 함수는 다중 파일 형식 CDF 파일에만 사용됩니다. 단일 파일 형식 CDF에는 적용되지 않습니다. 캐싱에 대한 자세한 내용은 CDF User's Guide를 참조하십시오.

입력 인수

cdfId

CDF 파일 ID로, cdflib.create 또는 cdflib.open 호출에서 반환됩니다.

varNum

파일의 변수를 식별하는 숫자형 값입니다. 변수 식별자(변수 번호)는 0부터 시작합니다.

numBuffers

사용할 캐시 버퍼의 수를 식별하는 숫자형 값입니다.

예제

다중 파일 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

참고 문헌

이 함수는 CDF 라이브러리 C API 루틴 CDFsetzVarCacheSize에 대응합니다.

이 함수를 사용하려면 CDF C 인터페이스를 잘 알고 있어야 합니다. CDF 웹사이트에서 CDF 문서에 액세스할 수 있습니다.