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 Record State 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 Commenting Stateflow Objects in a 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 comment out a state, box, or function that contains it.

    Comment text added to the junction, 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 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 character vector.

    Document link for the junction, specified as a 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
    dialogOpen properties dialog box
    isCommentedDetermine if graphical object is commented out
    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';
    Introduced before R2006a