Main Content

cdflib.setVarBlockingFactor

변수의 블로킹 인자(Blocking Factor) 지정

구문

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor)

설명

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor)는 CDF(Common Data Format) 파일의 변수에 대한 블로킹 인자를 지정합니다.

입력 인수

cdfId

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

varNum

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

blockingFactor

할당되지 않은 레코드에 쓸 때 할당할 레코드의 개수를 지정하는 숫자형 값입니다.

예제

CDF를 만들고 해당 CDF의 변수를 만든 다음 해당 변수와 함께 사용할 블로킹 인자를 설정합니다. 이 예제를 실행하려면 폴더 쓰기가 가능해야 합니다.

cdfId = cdflib.create("your_file.cdf");

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

% Get the current blocking factor used with the variable 
bFactor = cdflib.getVarBlockingFactor(cdfId,varNum)
bFactor =

     0
% Change the blocking factor for the variable
cdflib.setVarBlockingFactor(cdfId,varNum,10);

% Check the new blocking factor
bFactor = cdflib.getVarBlockingFactor(cdfId,varNum)
bFactor =

    10
%Clean up
cdflib.delete(cdfId)
clear cdfId

세부 정보

모두 축소

블로킹 인자

변수의 블로킹 인자는 할당되지 않은 레코드에 쓸 때 라이브러리가 할당하는 최소 레코드 개수를 지정합니다. 지정한 블로킹 인자가 소수인 경우 라이브러리가 값을 버림합니다.

참고 문헌

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

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