State Machine v/s Flow Chart.

65 views (last 30 days)
Vishal Shukla
Vishal Shukla on 19 Jun 2019
Answered: Tomasz Karczmarski on 18 Nov 2020
What is the difference between State Machine and Flow Chart in SateFlow ?

Answers (2)

stozaki
stozaki on 9 Jan 2020
Hello,
State machine is sequential decision logic and flow charts is combinatorial logic.
Please refer to the following documents.
Finite State Machine Concepts (MathWorks document)
Flow Charts in Stateflow (MathWorks document)
Regards,

Tomasz Karczmarski
Tomasz Karczmarski on 18 Nov 2020
If I tried to summarize stozaki's answer in a few sentences, it would go like this:
The main difference between flow chart and state machine is that flow charts represent an algorithm that will run from beginning to the end in one simulation step, while state machine contains temporary states that are reached during execution of the step, and represent the outcome of logic encoded in the state machine for that particular step. Upon commencing the next simulation step a flow chart will run again from the beginning to the end, consuming current inputs and computing outputs with no regard to what it computed before, while a state machine will resume from the state in which it ended up in the previous step and it will advance to another state (or stay in the same one) depending on current input, the logic programmed into the machine and the context in which it was put by previous inputs. That makes state machines well suited to model control systems.

Categories

Find more on Complex Logic in Help Center and File Exchange

Tags

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!