Modeling Mode Logic in Embedded MATLAB

version (11.7 KB) by Kiran Kintali
Implementing Mealy and Moore FSMS in an Embedded MATLAB block


Updated Thu, 01 Sep 2016 15:06:57 +0000

View License

A finite state machine is a representation of a reactive system. In an event-driven system, the system makes a transition from one state (mode) to another prescribed state, provided that the condition defining the change is true.
Stateflow is the best tool for modeling finite state machines. It provides very sophisticated capabilities to build hierarchical and parallel state machines, temporal logic and state entry/during/exit actions etc.,

However there are many Signal Processing and Communications applications where in when writing a very data flow centric algorithms, there comes a need to write a simple controller embedded in the algorithm.This example shows how to implement such a simple mealy or more state machine in Embedded MATLAB control using control flow constructs.

Mealy: y = f(x,u)
all actions are condition actions and outputs are function of state and input

Moore: y = f(x)
all actions are state actions and outputs are pure functions of state only

Cite As

Kiran Kintali (2022). Modeling Mode Logic in Embedded MATLAB (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!