Main Content

getVariableValue

Class: slreportgen.report.ModelVariable
Namespace: slreportgen.report

Get value of variable from model variable reporter

Syntax

value = getVariableValue(reporter)

Description

value = getVariableValue(reporter) returns the value of the model variable to be reported by the specified model variable reporter.

Input Arguments

expand all

Model variable reporter, specified as an slreportgen.report.ModelVariable.

Examples

expand all

After you get the reporter for a model variable result, you can use the getVariableValue method to get the variable value from the reporter.

...
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
...

Version History

Introduced in R2019b