Documentation Center

  • Trial Software
  • Product Updates

Contents

db_0134: Flowchart patterns for If constructs

ID: Title

db_0134: Flowchart patterns for If constructs

Priority

Strongly recommended

Scope

MAAB

MATLAB Versions

All

Description

Use the following patterns for If constructs within Stateflow® Flowcharts:

Equivalent FunctionalityFlowchart Pattern

if then

if (condition){  action; 
}

Equivalent FunctionalityFlowchart Pattern

if then else

if (condition){   action1;  
} 
else {
  action2;  
}

if then else if

if (condition1){   action1;  
} 
else if (condition2) {  action2;  
} 
else if (condition3){
__action3; 
} 
else {
  action4; 
} 

Equivalent FunctionalityFlowchart Pattern

Cascade of if then

if (condition1){  action1;     
  if (condition2){    action2;
    if (condition3){      action3;        
    }     
  }  
} 

Rationale

  • Readability

  • Verification and Validation

  • Workflow

  • Code Generation

  • Simulation

Last Changed

V1.0

Model Advisor Check

Not applicable

Was this topic helpful?