Contents

db_0148: Flow chart patterns for conditions

ID: Title

db_0148: Flow chart patterns for conditions

Priority

Strongly recommended

Scope

MAAB

MATLAB Versions

All

Prerequisites

None

Description

Use the following patterns for conditions within Stateflow® flow charts:

Equivalent FunctionalityFlow Chart Pattern
One condition:
[condition] 

Up to three conditions, short form:

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

[condition1 
&& condition2 
&& condition3]  
[condition1 
|| condition2 
|| condition3] 

Equivalent FunctionalityFlow Chart Pattern

Two or more conditions, multiline form:

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

[condition1 ... 
&& condition2 ... 
&& condition3]  
[condition1 ...  
|| condition2 ... 
|| condition3] 

Conditions with subconditions:

(The use of different logical operators to connect subconditions is not allowed. The use of brackets is mandatory.)

[(condition1a 
|| condition1b) ... 
&& (condition2a 
|| condition2b) ... 
&& (condition3)]  
[(condition1a 
&& condition1b) ... 
|| (condition2a 
&& condition2b) ... 
|| (condition3)] 

Equivalent FunctionalityFlow Chart Pattern

Conditions that are visually separated:

(This form may be combined with the preceding patterns.)

[condition1 
&& condition2] 
[condition1 
|| condition2]

Rationale

  • Readability

Last Changed

V2.2

Model Advisor Check

Not applicable

Was this topic helpful?