Main Content

getVariableName

Class: slreportgen.report.ModelVariable
Package: slreportgen.report

Get name of variable from model variable reporter

Syntax

name = getVariableName(reporter)

Description

name = getVariableName(reporter) returns the name 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 object.

Output Arguments

expand all

Name of model variable, returned as a character vector.

Examples

expand all

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

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

while hasNext(finder)
    result = next(finder);
    
    % Get the ModelVariable reporter for the result
    % Get the variable name
    reporter = getReporter(result);
    name = getVariableName(reporter);
    ...
    % Add the reporter to the chapter
    add(chapter,reporter);
end
...
Introduced in R2019b