Main Content

generateReport

Class: Advisor.Application
Package: Advisor

Generate report for Model Advisor analysis

Description

Generate a Model Advisor report for an Application object analysis.

example

generateReport(app) generates a Model Advisor report for each component specified by the Application object. By default, a report with the name of the analysis root is generated in the current folder.

example

generateReport(app,Name,Value) generates a Model Advisor report for each component specified by the Application object. Use the Name,Value pairs to specify the location and name of the report.

Input Arguments

expand all

Advisor.Application object, created by Advisor.Manager.createApplication

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Examples

expand all

This example shows how to generate a report with the analysis root name in the current folder.

% Open the model
openExample('sldemo_mdlref_basic');

% Set root model to  sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Run Model Advisor analysis
run(app);

% Generate report
report = generateReport(app);

% Open the report in web browser
web(report);

This example shows how to generate a report with a specified name and location.

% Open the model
openExample('sldemo_mdlref_basic');

% Set root model to  sldemo_mdlref_basic model
RootModel='sldemo_mdlref_basic';

% Create an Application object
app = Advisor.Manager.createApplication();

% Set the Application object root analysis
setAnalysisRoot(app,'Root',RootModel);

% Run Model Advisor analysis
run(app);

% Generate report in my_work directory
mkdir my_work
report = generateReport(app,'Location','my_work','Name','RootModelReport');

%Open the report in web browser
web(report);

Version History

Introduced in R2015b