cdflib.deleteAttrEntry
属性エントリの削除
構文
cdflib.deleteAttrEntry(cdfId,attrNum,entryNum)
説明
cdflib.deleteAttrEntry(cdfId,attrNum,entryNum)
は、CDF (Common Data Format) ファイル内の属性からエントリを削除します。
入力引数
|
関数 |
|
属性を識別する数値。属性番号は 0 ベースです。属性には変数スコープが必要です。 |
|
属性でのエントリを指定する数値。エントリ番号は 0 ベースです。 |
例
CDF を作成し、ファイルに属性を作成します。属性のエントリに値を書き込み、エントリを削除します。この例を実行するためには、書き込み可能なフォルダーに移動します。
cdfid = cdflib.create('your_file.cdf'); % Initially the file contains no attributes, global or variable. info = cdflib.inquire(cdfid) info = encoding: 'IBMPC_ENCODING' majority: 'ROW_MAJOR' maxRec: -1 numVars: 0 numvAttrs: 0 numgAttrs: 0 % Create an attribute with variable scope in the file. attrNum = cdflib.createAttr(cdfid,'my_var_scope_attr','variable_scope'); % Write a value to an entry for the attribute cdflib.putAttrEntry(cdfid,attrNum,0,'CDF_CHAR','My attr value'); % Get the value of the attribute entry value = cdflib.getAttrEntry(cdfid,attrNum,0) value = My attr value % Delete the entry cdflib.deleteAttrEntry(cdfid,attrNum,0); % Now try to view the value of the entry % Should return NO_SUCH_ENTRY failure. value = cdflib.getAttrEntry(cdfid,attrNum,0) % Should fail % Clean up cdflib.delete(cdfid); clear cdfid
参照
この関数は、CDF ライブラリ C API のルーチン CDFdeleteAttrzEntry
に相当します。
この関数を使用するには、CDF C インターフェイスに関する知識を必要とします。CDF のドキュメンテーションは CDF の Web サイトで参照できます。