Simulink® Code Inspector™ supports a subset of MATLAB Function block’s language and features for code inspection. The code inspector verifies the use of the MATLAB Function block. For the supported language and features, some constraints may apply. Before code inspection, when you check the compatibility of your model with code inspection rules, the compatibility checker detects and reports violations of MATLAB Function block constraints. Simulink Code Inspector supports the following for code inspection:
MATLAB Function block feature | What is supported |
---|---|
Data type |
|
Data dimension and complexity |
|
Data scope |
|
MATLAB Function block settings |
|
MATLAB® operations - scalar |
|
MATLAB operations - vector support |
|
MATLAB program statements |
|
MATLAB built-in functions |
|
Functions |
Note Simulink
Code Inspector supports verification of the
|
Reporting | Block level traceability and verification |
Mangled functions | Verification of mangled function names generated from a MATLAB Function block division expression. The Simulink Code Inspector report lists these functions so that you can manually verify the function body. Check the function body manually to be sure it is consistent with the function call. |
Size and type verification | Simulink Code Inspector gets size and type information for variables in the code from the block’s simulation data. To independently verify type and size information, you can use Simulink Report Generator™ to generate a System Design Description (SDD) report for your model. Check the SDD report for MATLAB Function block symbol data such as size, complexity, position, and function call sites. |
MATLAB Function Block Constraints divides the constraints into the following categories:
Constraints on the MATLAB Function block.
Constraints on the data in MATLAB functions.
Constraints on the code in MATLAB functions.
Constraints on MATLAB Code Analyzer messages.
A table provides the constraints that apply for each category.
For each entry in a table:
The Constraint column lists the Simulink Code Inspector constraint on the MATLAB Function block, data or code.
The FATAL / Nonfatal column identifies whether violation of the constraint terminates code inspection.
When you inspect code generated from models with a FATAL incompatibility, code inspection terminates. Code generated from models with FATAL incompatibilities cannot be verified.
When you inspect code generated from models with nonfatal incompatibilities, code inspection does not terminate. Although it might not be possible to fully verify the generated code, code inspection continues. The Simulink Code Inspector might partially verify the generated code. You can configure code inspection so that a nonfatal constraint violation terminates code inspection.
The Compatibility Check column lists the compatibility check that checks for violation of the constraint, and links to a description of the check.