Documentation

This is machine translation

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

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

na_0001: Bitwise Stateflow operators

ID: Title

na_0001: Bitwise Stateflow operators

Priority

Strongly recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

The bitwise Stateflow operators (&, |, and ^) should not be used in Stateflow charts unless you want bitwise operations:

To enable bitwise operations,

  1. Select File > Chart Properties.

  2. Select Enable C-bit operations.

Correct

Use && and || for Boolean operation.

Use & and | for bit operation.

Incorrect

Use & and | for Boolean operation.

Rationale

  • Readability

  • Verification and Validation

  • Code Generation

Last Changed

V2.2

Model Advisor Check

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

For check details, see Check for bitwise operations in Stateflow charts (Simulink Verification and Validation).

Introduced in R2010a

Was this topic helpful?