An atomic subchart is a graphical object that helps you to create standalone subcomponents in a Stateflow® chart. Atomic subcharts are supported only in Stateflow charts in Simulink® models. For more information, see Create Reusable Subcomponents by Using Atomic Subcharts.
Assume that you have the following model, and the chart has two states:
Suppose that you want to reduce the compilation time of the chart for simulation. You can convert state A to an atomic subchart. Then you can make changes, one by one, to state A and see how each change affects simulation results. Making one change requires recompilation of only the atomic subchart and not the entire chart.
Right-click state A and select Group & Subchart > Atomic Subchart.
Double-click the atomic subchart.
The contents of the subchart appear in a separate window.
Start simulation.
Side-by-side animation for the main chart and the atomic subchart occurs.
In the atomic subchart, change the state action for Pos
to y1 = 2
.
Restart simulation.
Recompilation occurs only for the atomic subchart and not the entire chart.