Access Statistics from SimEvents Blocks

Most SimEvents® blocks can produce one or more statistical output signals.

This procedure shows you how to access a statistical output signal for a given SimEvents block.

  1. Determine which statistical output signal you want to access and find the associated parameter in the block dialog box. To see which statistics are available, open the block dialog box. In most cases, the list of available statistics appears as a list of parameters on the Statistics tab of the dialog box. In cases where the dialog box has no Statistics tab, such as the Entity Sink block, the dialog box has so few parameters that the parameters associated with statistics are straightforward to locate.

  2. Select the check box. After you apply the change, the block has a new signal output port corresponding to that statistic.

  3. Connect the new signal output port to the signal input port of another block. The table lists some common examples.

    If You Want to...Use this Block...
    Create a plot using the statistic.Signal Scope or X-Y Signal Scope
    Show the statistic on the block icon throughout the simulation.Display
    Write the data set to the MATLAB® workspace when the simulation stops or pauses. To learn more, see Send Data to the MATLAB Workspace.Discrete Event Signal to Workspace
    Perform custom data processing. See Derive Custom Statistics for some specific examples.Custom subsystem or computational block

For more information about when SimEvents blocks update their statistical signals and when other blocks react to the updated values, see Role of Event-Based Signals in SimEvents.

Was this topic helpful?