MATLAB: Is it possible to produce a Stateflow diagram from within a MATLAB code

realtime visualizationstate diagramstateflowstateflow diagramvisuialization

Is it possible to produce a stateflow diagram from within a MATLAB code?
If so can anyone give me a simple example of producing a state diagram for example for two states s1 and s2 defining and showing all possible transitions? Or a trellis diagram for some, lets say like 5 sequences: [s1 s1 s2 s1 s2]?

Best Answer

Yes, this is possible. This is called "Stateflow API" and is documented here:
I can also recommend the following example code and a Technical Support knowledgbase article:
Related Question