Main Content

Stateflow.Junction

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

    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 superstate in its hierarchy.

    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 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.

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

    Radius of the junction, specified as a scalar.

    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

    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
    sinkedTransitionsReturn transitions that have object as destination
    sourcedTransitionsReturn transitions that have object as source
    upReturn parent of object
    viewDisplay object in editing environment

    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