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