Main Content

generateReport

Class: Advisor.Application
Namespace: Advisor

Generate report for Model Advisor analysis

Description

Generate a Model Advisor report for an Application object analysis.

generateReport(app) generates a Model Advisor report for each component specified by the Application object. By default, Model Advisor generates a summary report report.html and a report for each model component in a folder in the current working directory. The folder name is the name of the analysis root.

example

generateReport(___,Name,Value) specifies where the report generates using one or more Name,Value pair arguments. For example, you can specify the name and location of the folder that contains the generated Model Advisor reports.

example

Input Arguments

expand all

Model Advisor application object, specified as an Advisor.Application object. Create an Advisor.Application object by using the method 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.

Path to folder for generated report, specified as a character vector or string array.

By default, Model Advisor reports generate in a folder in the current working directory.

Example: report = generateReport(app,'Location','my_work')

Name of folder for generated reports, specified as a character vector or string array.

By default, the folder name is the name of the analysis root.

Example: report = generateReport(app,'Name','my_reports')

Examples

expand all

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

Open a model. For this example, open the model sldemo_mdlref_basic.

openExample('sldemo_mdlref_basic');

Create an Advisor.Application object.

app = Advisor.Manager.createApplication();

Specify the model sldemo_mdlref_basic as the root of the Model Advisor analysis.

RootModel='sldemo_mdlref_basic';
setAnalysisRoot(app,'Root',RootModel);

Run Model Advisor analysis.

run(app);

This code runs each of the selected checks. For information on how to run only specific checks, see Advisor.Application.

Generate Model Advisor reports.

report = generateReport(app);

Model Advisor generates a summary report report.html and a report for each model component. The reports generate inside a folder sldemo_mdlref_basic in the current working directory.

Open the summary report in a web browser.

web(report);

This example shows how to generate reports in a folder with a specific name and location.

Open a model. For this example, open the model sldemo_mdlref_basic.

openExample('sldemo_mdlref_basic');

Create an Advisor.Application object.

app = Advisor.Manager.createApplication();

Specify the model sldemo_mdlref_basic as the root of the Model Advisor analysis.

RootModel='sldemo_mdlref_basic';
setAnalysisRoot(app,'Root',RootModel);

Run Model Advisor analysis.

run(app);

Create a new folder named my_work in the current working directory.

mkdir my_work

Generate Model Advisor reports in a folder named my_reports in the folder my_work.

report = generateReport(app,...
'Location','my_work',...
'Name','my_reports');

Model Advisor generates a summary report report.html and a report for each model component.

Current Folder with "my_work" folder, "my_reports" subfolder, and the generated reports

Open the summary report in a web browser.

web(report);

Version History

Introduced in R2015b