Check type and size of condition expressions
mathworks.hism.himl_0011
Dependencies: Simulink® Check™
Usage: High-Integrity System Modeling
Guideline: himl_0011: Data type and size of condition expressions
Description
Use this check to verify that logical scalars are used for condition expressions.
Conditional expressions are:
if
expressionselseif
expressionswhile
expressionsCondition expressions of Stateflow® transitions
Check Parameters
Use the Model Advisor Configuration Editor to define the scope of the analysis by specifying the input parameters.
Parameter | Description |
---|---|
Check external .m files referenced in the model | Specify whether to run on referenced MATLAB® files in the model.
|
Follow links | Specify whether to include content of library-linked blocks in the analysis.
|
Look under masks | Specify whether to include masked model elements in the analysis.
|
Recommended Actions and Results
Review the violations that are flagged by the check and the recommended action for fixing the issue. After applying the changes, save the model and rerun the check analysis.
Modeling Condition | Recommended Action |
---|---|
| Change expression to a logical scalar. |
| Change expression to a logical scalar. |
| Change expression to a logical scalar. |
Condition expression of Stateflow transition expression is not a logical scalar. | Change expression to a logical scalar. |
Capabilities and Limitations
Does not check the conditions of Stateflow transitions and state actions when using C as the Stateflow action language
Does not run on library models
Analyzes content in masked subsystems
Analyzes content of library-linked blocks
Unreachable invariant conditions and code fragments might not be analyzed.
Supports only active variant choices
Performs model compilation
Tips
The results table identifies each expression that contains an expression that is not a logical scalar. To review the issue, select the corresponding function link from the result table. The Model Advisor opens and highlights the corresponding function definition or, for Stateflow, opens the chart and highlights the state in which the issue occurs.
Manually change the condition expressions to logical scalars. Save the model and rerun the check.
Version History
Introduced in R2019b
See Also
Topics
- Check Your Model Using the Model Advisor
- Address Model Check Results
- Save and View Model Advisor Check Reports
- Improve Simulation Performance Using Performance Advisor
- Upgrade Models Using Upgrade Advisor
- Use Model Advisor Configuration Editor to Customize Model Advisor
- Exclude Blocks from Model Advisor Check Analysis
- Justify Model Advisor Violations from Check Analysis
- Check Model Compliance Using Edit-Time Checking
- Represent Operating Modes by Using States (Stateflow)
- Transition Between Operating Modes (Stateflow)
- Differences Between MATLAB and C as Action Language Syntax (Stateflow)