Main Content

Stateflow.Unit

Unit of measurement for input and output data

    Description

    Use a Stateflow.Unit object to specify the unit of measurement for an input or output data object. For more information, see Specify Units for Stateflow Data.

    Creation

    Each data object and message has its own Stateflow.Unit object. However, the object only applies for Stateflow.Data objects when the Scope property is set to "Input" or "Output". To access the Stateflow.Unit object, use the Props.Unit property for the Stateflow.Data 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.

    Name of unit of measurement, specified as a string scalar or character vector. This property applies only to input and output data.

    Examples

    collapse all

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

    properties = x.Props;
    unit = properties.Unit;

    Specify the units as meters.

    unit.Name = "m";

    Version History

    Introduced before R2006a