Main Content

Stateflow.FixptType

Fixed-point properties for data and messages

    Description

    Use a Stateflow.FixptType object to specify the fixed-point properties for a data object or message. For more information, see Fixed-Point Data in Stateflow Charts.

    Creation

    Each data object and message has its own Stateflow.FixptType object. To access the Stateflow.FixptType object, use the Props.Type.Fixpt 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.

    Method for scaling the fixed-point data object or message data, specified as "Binary point", "Slope and bias", or "None".

    Fraction length, in bits, specified as a string scalar or character vector. This property applies only to fixed-point data when the ScalingMode property is "Binary point".

    Slope, specified as a string scalar or character vector. This property applies only to fixed-point data when the ScalingMode property is "Slope and bias".

    Bias, specified as a string scalar or character vector. This property applies only to fixed-point data when the ScalingMode property is "Slope and bias".

    Whether to prevent replacement of the fixed-point type with an autoscaled type chosen by the Fixed-Point Tool (Fixed-Point Designer), specified as a numeric or logical 1 (true) or 0 (false). For more information, see Iterative Fixed-Point Conversion Using the Fixed-Point Tool (Fixed-Point Designer).

    Examples

    collapse all

    Access the Stateflow.Props, Stateflow.DataType, and Stateflow.FixptType objects for the Stateflow.Data object x.

    properties = x.Props;
    type = properties.Type;
    fixpt = type.Fixpt;

    Specify the fixed-point properties.

    type.Method = "Fixed point";
    type.Signed = true;
    type.WordLength = "5";
    fixpt.ScalingMode = "Binary point";
    fixpt.FractionLength = "2";
    

    Verify the data type.

    x.DataType
    ans =
        'fixdt(1,5,2)'
    

    Version History

    Introduced before R2006a