このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。
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 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 variable scope in the file attrNum = cdflib.createAttr(cdfId,"myVarScopeAttr","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 try value = cdflib.getAttrEntry(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 のルーチン CDFdeleteAttrzEntry
に相当します。
この関数を使用するには、CDF C インターフェイスに関する知識を必要とします。CDF のドキュメンテーションは CDF の Web サイトで参照できます。