This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

na_0013: Comparison operation in Stateflow

ID: Title

na_0013: Comparison operation in Stateflow

Priority

Recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

  • Comparisons should be made only between variables of the same data type.

  • If comparisons are made between variables of different data types, the variables need to be explicitly type cast to matching data types.

Correct

Same data type in “i” and “n”

Incorrect

Different data type in “i” and “d”

Correct

Do not make comparisons between unsigned integers and negative numbers.

Incorrect

Rationale

  • Verification and Validation

  • Code Generation

  • Simulation

Last Changed

V2.1

Model Advisor Check

By Task > Modeling Standards for MAAB > Stateflow > Check for comparison operations in Stateflow charts

For check details, see Check for comparison operations in Stateflow charts (Simulink Check).

Introduced in R2010a