主要内容

cdflib.getConstantValue

与常用数据格式 (CDF) 库常量对应的数值

语法

value = cdflib.getConstantValue(constantName)

说明

value = cdflib.getConstantValue(constantName) 返回在 constantName 中指定的 CDF 库常量的数值。将 constantName 指定为字符串标量或字符向量。要查看常量名称的列表,请使用 cdflib.getConstantNames

示例

全部折叠

创建 CDF 库中命名常量的列表。

names = cdflib.getConstantNames;

显示第一个常量的名称和值。

name = names{1};
value = cdflib.getConstantValue(name);
message = sprintf("The constant %s has value %d.",name,value)
message = 
"The constant AHUFF_COMPRESSION has value 3."

提示

  • 此函数是一个 MATLAB® 工具函数,它与 CDF 库 C API 中的任何函数都不对应。