主要内容

本页采用了机器翻译。点击此处可查看英文原文。

getVariableValue

类: slreportgen.report.ModelVariable
命名空间: slreportgen.report

从模型变量报告器获取变量的值

语法

value = getVariableValue(reporter)

说明

value = getVariableValue(reporter) 返回指定模型变量报告器要报告的模型变量的值。

输入参数

全部展开

模型变量报告器,指定为 slreportgen.report.ModelVariable

示例

全部展开

获取模型变量结果的报告器后,您可以使用 getVariableValue 方法从报告器中获取变量值。

...
finder = slreportgen.finder.ModelVariableFinder(model);

while hasNext(finder)
    result = next(finder);
    
    % Get the ModelVariable reporter for the result
    % Get the variable value
    reporter = getReporter(result);
    value = getVariableValue(reporter);
    ...
    % Add the reporter to the chapter
    add(chapter,reporter);
end
...

版本历史记录

在 R2019b 中推出