Main Content

Stateflow.SigLoggingInfo

Signal logging properties for states and data

    Description

    Use a Stateflow.SigLoggingInfo object to specify the signal logging properties for a state or data object. Signal logging saves the self activity of a state or the values of a data object to the MATLAB® workspace during simulation. For more information, see Log Simulation Output for States and Data.

    Creation

    Each state, atomic subchart, Simulink® based state, and data object has its own Stateflow.SigLoggingInfo object. To access the Stateflow.SigLoggingInfo object, use the LoggingInfo property for the Stateflow.State, Stateflow.AtomicSubchart, Stateflow.SimulinkBasedState, or 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.

    Whether to enable signal logging for the state or data object, specified as a numeric or logical 1 (true) or 0 (false).

    Whether to limit the amount of logged data, specified as a numeric or logical 1 (true) or 0 (false). When this property is true, signal logging skips samples by using the interval size specified by the Decimation property. For more information, see Decimation.

    Decimation interval, specified as an integer scalar. This property applies only when the DecimateData property is true. The default value of 2 means that the chart logs every other sample.

    Whether to limit the number of data points to log, specified as a numeric or logical 1 (true) or 0 (false). When this property is true, signal logging limits the number of data points by using the value specified by the MaxPoints property. For more information, see Limit data points to last.

    Maximum number of data points to log, specified as an integer scalar. This property applies only when the LimitDataPoints property is true. The default value of 5000 means the chart logs only the last 5000 data points generated by the simulation.

    Source of the signal name used to log the state or data object, specified as one of these values:

    • "SignalName" — Use the name of the state or data object.

    • "Custom" — Use the custom signal name specified by the LoggingName property.

    For more information, see Logging name.

    Custom signal name for the state or data object, specified as a string scalar or character vector. This property applies only when the NameMode property is "Custom".

    Examples

    collapse all

    Access the SigLoggingInfo object for the Stateflow.Data object x.

    log = x.LoggingInfo;

    Enable logging for the data object and specify a custom signal name.

    log.DataLogging = true;
    log.NameMode = "Custom";
    log.LoggingName = "My Data";

    Version History

    Introduced before R2006a