Main Content

cdflib.getAttrgEntry

全局属性中条目的值

语法

value = cdflib.getAttrgEntry(cdfId,attrNum,entryNum)

说明

value = cdflib.getAttrgEntry(cdfId,attrNum,entryNum) 返回常用数据格式 (CDF) 文件中全局属性条目的值。

输入参数

cdfId

CDF 文件的标识符,通过调用 cdflib.createcdflib.open 返回。

attrNum

数值,用于标识属性。属性编号从 0 开始。该属性必须具有全局作用域。

entryNum

数值,用于指定属性中的条目。条目编号从 0 开始。

输出参量

Value

条目的值。

示例

打开示例 CDF 文件,然后获取与该文件中的全局属性关联的条目的值。

cdfId = cdflib.open("example.cdf");

% All of the first three attributes have global scope
attrscope = cdflib.getAttrScope(cdfId,0)
attrscope =

    'GLOBAL_SCOPE'
% Get information about the first entry for global attribute
[dtype,numel] = cdflib.inquireAttrgEntry(cdfId,0,0)
dtype =

    'cdf_char'


numel =

    23
% Get the value of the first entry for this global attribute
value = cdflib.getAttrgEntry(cdfId,0,0)
value =

    'This is a sample entry.'
% Clean up
cdflib.close(cdfId)
clear cdfId

参考

此函数对应于 CDF 库的 C API 例程 CDFgetAttrgEntry

要使用此函数,必须熟悉 CDF C 接口。您可以在 CDF 网站上访问 CDF 文档。

版本历史记录

全部展开