Main Content

Stateflow.DataArray

Array properties for data and messages

    Description

    Use a Stateflow.DataArray object to specify the array properties for a data object or message.

    Creation

    Each data object and message has its own Stateflow.DataArray object. To access the Stateflow.DataArray object, use the Props.Array property for the Stateflow.Data or Stateflow.Message object.

    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.

    Size of the data object or message data, specified as a string scalar or character vector. For more information, see Specify Size of Stateflow Data.

    Whether the data object has variable size, specified as a numeric or logical 1 (true) or 0 (false). This property is equivalent to the Variable Size check box in the Property Inspector, the Model Explorer, or the Data properties dialog box. For more information, see Declare Variable-Size Data in Stateflow Charts.

    Index for the first element of the array data object, specified as a string scalar or character vector. This property applies only to array data in charts that use C as the action language. For more information, see Save final value to base workspace.

    Examples

    collapse all

    Access the Stateflow.Props and Stateflow.DataArray objects for the Stateflow.Data object x.

    properties = x.Props;
    array = properties.Array;

    Specify the size of the data object.

    array.size = "[2 3]";

    Version History

    Introduced before R2006a