| Contents | Index |
| On this page… |
|---|
Converting a State or Subchart to an Atomic Subchart Converting an Atomic Subchart to a State or Subchart Restrictions for Converting an Atomic Subchart to a State or Subchart |
To convert a state or subchart to an atomic subchart, right-click the object in your chart and select Make Contents > Atomic Subcharted.
After you convert a state or subchart to an atomic subchart, local data appears as data store memory in the atomic subchart.
| Scope of Data Before Conversion | Scope of Data After Conversion |
|---|---|
| Input | Input |
| Output | Output |
| Local | Data store memory |
| Parameter | Parameter |
| Constant | Constant |
An atomic subchart looks opaque like a regular subchart but includes the label (Atomic) in the upper-left corner. If you use a linked atomic subchart from a library, the label (Link) appears in the upper-left corner.
For example, the following model contains a chart, Air Controller, that uses an atomic subchart:

In the Air Controller chart, PowerOn is an atomic subchart, but PowerOff is a regular subchart:

To convert a linked atomic subchart back to a state or subchart:
Right-click the atomic subchart and select Link Options > Disable Link.
Follow the steps in When an Atomic Subchart Is Not a Library Link.
| To convert an atomic subchart back to... | Follow these steps... |
|---|---|
A state |
|
A regular subchart |
|
In the following cases, converting an atomic subchart to a state or subchart does not work:
Your atomic subchart uses a MATLAB function and contains a nontrivial mapping of variables. A mapping is nontrivial when the variable in the subchart does not map to another variable of the same name in the container chart.
A parameter in the atomic subchart maps to something other than a single variable. For example, the following mappings for a parameter named data1 prevent conversion of an atomic subchart to a state or subchart:
data2 + 3
data2.3
data2(3)
3
For more information, see Mapping Variables for Atomic Subcharts.
![]() | Restrictions for Converting to Atomic Subcharts | Mapping Variables for Atomic Subcharts | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |