Main Content

Stateflow.Junction

Connective or history junction in chart, state, box, or function

    Description

    Use Stateflow.Junction objects to create junctions that:

    • Represent decision points in a transition path

    • Record the activity of substates inside a superstate

    For more information, see Combine Transitions and Junctions to Create Branching Paths and Resume Prior Substate Activity by Using History Junctions.

    Creation

    Description

    example

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

    Input Arguments

    expand all

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

    Properties

    expand all

    Stateflow API objects have properties that correspond to the values you set in the Stateflow Editor. To access or modify a property, use dot notation. To access or modify multiple properties for multiple API objects, use the get and set functions, respectively. For more information, see Modify Properties and Call Functions of Stateflow Objects.

    Content

    Type of junction, specified as one of these values:

    • "CONNECTIVE" — Connective junction that represents a decision point in a transition path

    • "HISTORY" — History junction that records the activity of substates inside a superstate

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

    This property is read-only.

    Whether the junction is implicitly commented out, specified as a numeric or logical 1 (true) or 0 (false). The junction is implicitly commented out when you explicitly comment out an object that contains it. If the junction is contained in an atomic subchart or an atomic box, this property is false unless the explicitly commented object is also contained in the atomic subchart or atomic box.

    Since R2023a

    This property is read-only.

    Whether the junction is commented out, specified as a numeric or logical 1 (true) or 0 (false). This property is true when either IsExplicitlyCommented or IsImplicitlyCommented is true.

    Comment text added to the junction, specified as a string scalar or 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 junction, 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 junction, specified as a Stateflow.JunctionPosition object with these properties:

    • Center — Position of the center of the junction, specified as a two-element numeric vector [x y] of coordinates relative to the upper left corner of the chart.

    • Radius — Radius of the junction, specified as a scalar.

    Example: junction.Position.Center = [31.41 27.18];

    Example: junction.Position.Radius = 16.18;

    Size of incoming transition arrows, specified as a scalar.

    Hierarchy

    This property is read-only.

    Chart that contains the junction, specified as a Stateflow.Chart object.

    This property is read-only.

    Subviewer for the junction, 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 junction.

    This property is read-only.

    Machine that contains the junction, specified as a Stateflow.Machine object.

    This property is read-only.

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

    Identification

    Description for the junction, specified as a string scalar or character vector.

    Document link for the junction, specified as a string scalar or character vector.

    User-defined tag for the junction, 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 junction 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

    getParentIdentify parent of object
    sinkedTransitionsIdentify transitions with specified destination
    sourcedTransitionsIdentify transitions with specified source
    commentedByIdentify objects that implicitly comment out a graphical object
    dialogOpen properties dialog box
    viewDisplay object in editing environment
    highlightHighlight graphical object
    fitToViewZoom in on graphical object

    Examples

    collapse all

    Add a connective junction in the chart ch. Change its size and position.

    junction = Stateflow.Junction(ch);
    junction.Position.Radius = 16.18;
    junction.Position.Center = [31.41 27.18];

    Add a history junction in the chart ch.

    junction = Stateflow.Junction(ch);
    junction.Type = "HISTORY";

    Version History

    Introduced before R2006a

    expand all