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_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

Introduced in R2010a

Was this topic helpful?