checkCompatibility

Check model compatibility with code inspection

Description

results = checkCompatibility(cfgObj,Name,value) checks a model for compatibility with Simulink® Code Inspector™, returns results information, and displays the results in the Command Window based on the settings specified in name-value pair arguments. To specify whether the scope of the compatibility check encompasses referenced models, use the setFollowModelLinks function.

Examples

Check Model Compatibility with Simulink Code Inspector

Run compatibility checker and display the checks results in the Command Window.

Create a configuration object for model slcidemo_roll_orig

config = slci.Configuration('slcidemo_roll_orig');

Run the compatibility checker by using the configuration object.

result = checkCompatibility(config, 'DisplayResults','None');

See the compatibility checks results.

for i = 1:length(result)
    fprintf('\nModel ''%s'' passed %d checks with %d issues.',...
        result{i}.system,...
        result{i}.numPass, result{i}.numWarn + result{i}.numFail)
end
Model 'slcidemo_roll' passed 68 checks with 0 issues.>> 

Input Arguments

collapse all

Use the slci.Configuration function to create a Simulink Code Inspector configuration object for a model.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: results = checkCompatibility(cfgObj,'DisplayResults','Summary')
ValueDescription
SummaryDisplays a summary of the model compatibility checks results in the Command Window. Creates a detailed compatibility checks report and displays a link to the report in the Command Window.
Details

Displays the following in the Command Window:

  • Which system is being checked while the run is in progress.

  • For each system, the pass and fail results of each individual check.

  • A summary of the system results.

NoneDisplays no information in the Command Window.

Output Arguments

collapse all

Results returned as a cell array where each cell corresponds to a checked model. The cells contain a ModelAdvisor.SystemResult object for each checked model. Each ModelAdvisor.SystemResult object contains an array of CheckResultObj objects. Each CheckResultObj object is for a check that runs on the corresponding model.

Tips

Before running Simulink Code Inspector on a model, run compatibility checks and modify the model repeatedly until the model is compatible with code inspection.

Alternatives

In the model window, on the Apps tab, select Code Inspector. Use the Simulink Code Inspector dialog box, to configure and run the compatibility checker. You can run the compatibility checker for a top model hierarchy by clicking Check this model.

Introduced in R2011b