Main Content

Check type and size of condition expressions

Check ID: mathworks.hism.himl_0011

Description

This check evaluates the model to check that logical scalars are used for these condition expressions:

  • if expressions

  • elseif expressions

  • while expressions

  • Condition expressions of Stateflow® transitions

Available with Simulink® Check™.

Results and Recommended Actions

ConditionRecommended Action

if expression is not a logical scalar.

Change expression to a logical scalar.

elseif expression is not a logical scalar.

Change expression to a logical scalar.

while expression is not 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.

Action Results

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.

Capabilities and Limitations

  • The conditions of Stateflow transitions and state actions are not checked when using C as the Stateflow action language.

  • This check 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.

See Also