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.

db_0134: Flow chart patterns for If constructs

ID: Title

db_0134: Flow chart patterns for If constructs

Priority

Strongly recommended

Scope

MAAB

MATLAB Versions

All

Description

Use the following patterns for If constructs within Stateflow® flow charts:

Equivalent FunctionalityFlow Chart Pattern

if then

if (condition){  action; 
}

Equivalent FunctionalityFlow Chart 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 FunctionalityFlow Chart 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

Introduced in R2010a

Was this topic helpful?