Documentation Center

  • Trial Software
  • Product Updates

Contents

db_0150: State machine patterns for conditions

ID: Title

db_0150: State machine patterns for conditions

Priority

Strongly recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

The following patterns are used for conditions within Stateflow® state machines:

Equivalent FunctionalityState Machine Pattern
One condition:
(condition) 

Equivalent FunctionalityState Machine Pattern

Up to three conditions, short form:

(The use of different logical operators in this form is not allowed. Use subconditions instead.)

(condition1 && 
condition2) 
(condition1 || 
condition2)

Two or more conditions, multiline form:

A subcondition is a set of logical operations, all of the same type, enclosed in parentheses.

(The use of different operators in this form is not allowed. Use subconditions instead.)

(condition1 ... 
&& condition2 ... 
&& condition3) 
(condition1 ... 
|| condition2 ...
|| condition3)

Rationale

  • Readability

Last Changed

V2.2

Model Advisor Check

Not applicable

Was this topic helpful?