State Machine v/s Flow Chart.
39 views (last 30 days)
Show older comments
What is the difference between State Machine and Flow Chart in SateFlow ?
0 Comments
Answers (2)
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)
Combinational logic (Wiki)
Sequential logic (Wiki)
Regards,
0 Comments
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.
0 Comments
See Also
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!