Search code examples
matlabsimulinkstateflow

Copy stateflow in a Simulink model


I would like to copy a Stateflow chart

The command:

Simulink.SubSystem.copyContentsToBlockDiagram(subsys, bdiag)

doesn't work on a Stateflow chart alone, rather then only on subsystems.

How could I copy a selected Stateflow to another system?


Solution

  • I think you need to use the Stateflow API (which is different from the Simulink one), in particular this example on Copy Objects looks like what you are trying to do.