Contenido principal

ModelAdvisor.SystemResult

Access system-level Model Advisor results

Description

View Model Advisor results obtained by using the run method.

Creation

To access the properties of a SystemResult object, apply the getResults method to an Advisor.Application object. If you run Model Advisor by using the ModelAdvisor.run, it returns the results as a SystemResult object. You can directly access the object properties.

Properties

expand all

Model or subsystem that the Model Advisor analyzes.

Data Types: char

Type of model component that Model Advisor analyzes.

Data Types: char

Numbers of checks with different statues, returned as a structure. The returned structure contains these fields:

  • NotRun — Number of Model Advisor checks that do not run

  • Information — Number of Model Advisor checks with information

  • Passed — Number of Model Advisor checks that pass

  • Justified — Number of Model Advisor checks that are Justified

  • Warning — Number of Model Advisor checks that warn

  • Failed — Number of Model Advisor checks that fail

  • Incomplete — Number of Model Advisor checks that ran incompletely

Data Types: structure

Cell array containing a ModelAdvisor.CheckResult object for each Model Advisor check. Access these object properties to obtain Model Advisor check results.

Details of Simulink® version, MATLAB® version, and model version in use, returned as a structure. The returned structure contains these fields:

  • SimulinkVersion — Details of Simulink version in use

  • MATLABVersion — Details of MATLAB version in use

  • ModelVersion— Details of model version in use

Details of configuration settings, justifications, exclusions, options, and analysis duration, returned as a structure. The returned structure contains these fields:

  • ConfigurationFile — Name of the configuration file in use

  • JustificationFile — Name of the generated justification file

  • ExclusionFile— Name of the file that contains the list of checks that need to be excluded from analysis

  • AnalysisOptions— Details of Model Advisor analysis options, returned as a structure. The returned structure contains these fields:

    Analysis OptionDescription
    DisplayResults

    Result display setting for Model Advisor in use.

    'Summary' (default) | 'Details' | 'None'

    • 'Summary' — Displays summary of the system results in the command window.

    • 'Details' — Displays real-time progress updates on the system being checked, the pass and fail results for each check, and a summary of the system results in the command window.

    • 'None' — Displays no information in the command window.

    TempDir

    Indicates whether the temporary working folder setting for Model Advisor is in use.

    'on' (default) | 'off' |

    • 'on' — Runs Model Advisor from a temporary working folder to avoid concurrency issues when running using a parallel pool.

    • 'off' — Runs Model Advisor in the current working folder.

    Force

    Indicates whether the force delete setting for Model Advisor is in use.

    'on' (default) | 'off' |

    • 'on' — Removes the existing modeladvisor/system folders.

    • 'off' — Prompts you before removing existing modeladvisor/system folders.

    ShowExclusions

    Indicates whether the report exclusion display setting for Model Advisor report is in use.

    'on' (default) | 'off' |

    • 'on' — Lists the Model Advisor check exclusions in the report.

    • 'off' — Does not list the Model Advisor check exclusions in the report.

    TreatAsMdlRef

    Indicates whether a model is treated as a referenced model.

    [] (default) | 'on' | 'off'

    • [] — There are referenced models in the system.

    • 'on' — Model is used as a referenced model.

    • 'off' — Model is not used as a referenced model.

    ParallelMode

    Indicates whether the parallel execution setting for Model Advisor is in use.

    'off' (default) | 'on'

    • 'off' — Model Advisor does not run in parallel mode.

    • 'on' — Model Advisor runs in parallel mode if you have a Parallel Computing Toolbox™ license and a multicore machine. Each parallel process runs checks on one model at a time.

    ExtensiveAnalysis

    Indicates whether the extensive analysis setting for Model Advisor is in use.

    'on' (default) | 'off'

    • 'on' — Model Advisor runs all the checks including the checks that trigger extensive analysis.

    • 'off' — Model Advisor does not run checks that trigger extensive analysis.

    LogVerbosity

    Indicates whether the details of log information, such as errors, warnings, and debug details, are provided.

    'None' (default) | 'Concise' | 'Verbose'

    • 'None' — No log information of analysis

    • 'Concise' — Moderate amount of information that includes errors and warnings

    • 'Verbose' — Complete information that includes errors, warnings, and debug details

    LogFileName of the log text file that includes the log information.
    ReportFormat

    Format of the generated Model Advisor report.

    'html' (default) | 'pdf' | 'docx'

    • 'html' — Model Advisor report is in HTML format.

    • 'pdf' — Model Advisor report is in PDF format.

    • 'docx' — Model Advisor report is in DOCX format

    ReportPathPath to the folder for the generated Model Advisor report.
    ReportNameName of the Model Advisor report.

  • AnalysisTimeStamp— Time details indicating when the analysis was completed in the DD-MMM-YYYY HH:MM:SS format.

Object Functions

getCheckResultsAccess specific Model Advisor check results

Examples

collapse all

This example shows how to run a check on model sldemo_mdlref_counter referenced from sldemo_mdlref_basic.

In the Command Window, open model sldemo_mdlref_basic and referenced model sldemo_mdlref_counter.

openExample('sldemo_mdlref_basic'); 
openExample('sldemo_mdlref_counter');

Save a copy of the models to a work folder, renaming them to mdlref_basic and mdlref_counter.

save_system('sldemo_mdlref_basic','mdlref_basic');
save_system('sldemo_mdlref_counter','mdlref_counter');

In mdlref_basic, change model reference from sldemo_mdlref_counter to mdlref_counter. Save mdlref_basic.

set_param('mdlref_basic/CounterA','ModelName','mdlref_counter');
set_param('mdlref_basic/CounterB','ModelName','mdlref_counter');
set_param('mdlref_basic/CounterC','ModelName','mdlref_counter');
save_system('mdlref_basic');

Set root model to mdlref_basic.

RootModel='mdlref_basic';

Create an Application object.

app = Advisor.Manager.createApplication();

Set root analysis.

setAnalysisRoot(app,'Root',RootModel);

Clear check instances from Model Advisor analysis.

deselectCheckInstances(app);

Select check Identify unconnected lines, input ports, and output ports using check instance ID.

instanceID = getCheckInstanceIDs(app,'mathworks.design.UnconnectedLinesPorts');
checkinstanceID = instanceID(1);
selectCheckInstances(app,'IDs',checkinstanceID);

Run Model Advisor analysis.

run(app);

Get analysis results and view the properties of the ModelAdvisor.SystemResult and ModelAdvisor.CheckResult objects.

Results=getResults(app);

Generate and view the Model Advisor report. The Model Advisor runs the check on both mdlref_basic and mdlref_counter.

report = generateReport(app);
web(report)

Close the models.

close_system('mdlref_basic');
close_system('mdlref_counter');

Version History

Introduced in R2015b

expand all