メインコンテンツ

cdflib.setVarBlockingFactor

変数のブロッキング ファクターの指定

構文

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor)

説明

cdflib.setVarBlockingFactor(cdfId,varNum,blockingFactor) は、CDF (Common Data Format) ファイル内の変数のブロッキング ファクターを指定します。

入力引数

cdfId

関数 cdflib.create または関数 cdflib.open の呼び出しによって返される、CDF ファイル識別子。

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 の Web サイトで参照できます。