Main Content

Stateflow.AtomicBox

Atomic box in chart, state, box, or function

    Description

    Use Stateflow.AtomicBox objects to encapsulate graphical, truth table, MATLAB®, and Simulink® functions in a separate namespace. Atomic boxes allow for:

    • Faster simulation after making small changes to a function in a chart with many states or levels of hierarchy

    • Reuse of the same functions across multiple charts and models

    • Ease of team development for people working on different parts of the same chart

    • Manual inspection of generated code for a specific function in a chart

    For more information, see Reuse Functions by Using Atomic Boxes.

    Creation

    Description

    example

    atomicBox = Stateflow.AtomicBox(parent) creates a Stateflow.AtomicBox object in a parent chart, state, box, or graphical function.

    Input Arguments

    expand all

    Parent for the new atomic box, specified as a Stateflow® API object of one of these types:

    Properties

    expand all

    Content

    Name of the atomic box, specified as a character vector.

    Full label for the atomic box, specified as a character vector.

    This property is read-only.

    Whether the atomic box is a library link, specified as a numeric or logical 1 (true) or 0 (false).

    Whether to comment out the atomic box, specified as a numeric or logical 1 (true) or 0 (false). Setting this property to true is equivalent to right-clicking the atomic box and selecting Comment Out. For more information, see Commenting Stateflow Objects in a Chart.

    This property is read-only.

    Whether the atomic box is implicitly commented out, specified as a numeric or logical 1 (true) or 0 (false). The atomic box is implicitly commented out when you comment out a superstate in its hierarchy.

    Comment text for the atomic box, specified as a character vector. This property applies only when the IsExplicitlyCommented property is true. In the Stateflow Editor, when you point to the comment badge on the atomic box, the text appears as a tooltip. When you set the IsExplicitlyCommented property to false, the value of CommentText reverts to ''.

    Graphical Appearance

    Position and size of the atomic box, specified as a four-element numeric vector of the form [left top width height].

    This property is read-only.

    Whether the atomic box graphically intersects a box, state, or function, specified as a numeric or logical 1 (true) or 0 (false).

    Whether to display a preview of the atomic box contents, specified as a numeric or logical 1 (true) or 0 (false).

    Font size for the atomic box label, specified as a scalar. The StateFont.Size property of the chart that contains the atomic box sets the initial value of this property.

    Hierarchy

    This property is read-only.

    Chart that contains the atomic box, specified as a Stateflow.Chart object.

    This property is read-only.

    Contents of the atomic box, specified as a Stateflow.Chart object. Use this object to add children, such as states and transitions, to the atomic box.

    This property is read-only.

    Subviewer for the atomic box, specified as a Stateflow.Chart, Stateflow.State, Stateflow.Box, or Stateflow.Function object. The subviewer is the chart or subchart where you can graphically view the atomic box.

    This property is read-only.

    Machine that contains the atomic box, specified as a Stateflow.Machine object.

    This property is read-only.

    Location of the parent of the atomic box in the model hierarchy, specified as a character vector.

    Identification

    Description for the atomic box, specified as a character vector.

    Document link for the atomic box, specified as a character vector.

    User-defined tag for the atomic box, specified as data of any type.

    This property is read-only.

    Session-independent identifier, specified as an integer scalar. Use this property to distinguish the atomic box from other objects in the model.

    This property is read-only.

    Unique identifier, specified as an integer scalar. Unlike SSIdNumber, the value of this property is reassigned every time you start a new MATLAB session and may be recycled after an object is deleted.

    Object Functions

    classhandleProvide class handle for object
    dialogOpen properties dialog box
    fitToViewZoom in on graphical object
    getReturn MATLAB structure containing property settings of object or array of objects
    highlightHighlight graphical object
    isCommentedDetermine if object is commented out
    setSet properties with specified values
    upReturn parent of object
    viewDisplay object in editing environment

    Examples

    collapse all

    Add an atomic box in the chart ch. Set its name to 'A'.

    atomicBox = Stateflow.AtomicBox(ch);
    atomicBox.Name = 'A';
    Introduced in R2012b