Main Content

cdflib.getAttrEntry

具有可变范围的属性中条目的值

语法

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

说明

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

输入参数

cdfId

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

attrNum

数值,用于标识属性。属性编号从 0 开始。该属性必须具有可变的范围。

entryNum

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

输出参数

Value

条目的值。

示例

打开示例 CDF 文件,然后获取与该文件中具有可变范围的属性关联的条目的值。

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

% The fourth attribute is of variable scope
attrscope = cdflib.getAttrScope(cdfId,3)
attrscope =

    'VARIABLE_SCOPE'
% Get information about the first entry for this attribute
[dtype,numel] = cdflib.inquireAttrEntry(cdfId,3,0)
dtype =

    'cdf_char'


numel =

    10
% Get the value of the entry for this attribute
% Note that it is a character vector of length 10
value = cdflib.getAttrEntry(cdfId,3,0)
value =

    'Time value'
% Clean up
cdflib.close(cdfId)
clear cdfId

参考

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

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

版本历史记录

全部展开