Configure the Simulation Data Inspector

The Simulation Data Inspector supports a wide range of use cases for analyzing and visualizing data. You can modify preferences in the Simulation Data Inspector to match your visualization and analysis requirements. The preferences that you specify persist between MATLAB® sessions.

By specifying preferences in the Simulation Data Inspector, you can configure options such as:

  • How signals and metadata are displayed.

  • Which data automatically imports from parallel simulations.

  • Where prior run data is retained and how much prior data to store.

  • How much memory is used during save operations.

  • The system of units used to display signals.

Open the Simulation Data Inspector preferences by selecting the Preferences button.

Note

You can restore all preferences in the Simulation Data Inspector to default values by clicking Restore Defaults in the dialog or by using the Simulink.sdi.clearPreferences function.

Incoming Run Names and Location

You can configure how the Simulation Data Inspector handles incoming runs from import or simulation. You can choose whether new runs are added at the top of the work area or the bottom and specify a naming rule to use for runs created from simulation.

By default, the Simulation Data Inspector adds new runs below prior runs in the work area. The Archive settings also affect the location of runs. By default, prior runs are moved to the archive when a new simulation run is created.

The run naming rule is used to name runs created from simulation. You can create the run naming rule using a mix of literal text that is used in the run name as-is and one or more tokens that represent metadata about the run. By default, the Simulation Data Inspector names runs using the run index and model name: Run <run_index>: <model_name>.

Tip

To rename an existing run, double-click the name in the work area and enter the new name, or modify the run name in the Properties pane.

Programmatic Use

You can programmatically check and modify the naming rule using the Simulink.sdi.getRunNamingRule and Simulink.sdi.setRunNamingRule functions. Restore the naming rule to its default programmatically using the Simulink.sdi.resetRunNamingRule function.

Signal Metadata to Display

You can control which signal metadata is displayed in the work area of the Inspect pane and in the results section on the Compare pane in the Simulation Data Inspector. You specify the metadata to display separately for each pane using the Table Columns preferences in the Inspect and Compare sections of the Preferences dialog, respectively.

Inspect Pane

By default, the signal name and the line style and color used to plot the signal are displayed on the Inspect pane. To display different or additional metadata in the work area on the Inspect pane, select the check box next to each piece of metadata you want to display in the Table Columns preference in the Inspect section. You can always view complete metadata for the selected signal in the Inspect pane using the Properties pane.

Note

Metadata displayed in the work area on Inspect pane is included when you generate a report of plotted signals. You can also specify metadata to include in the report regardless of what is displayed in the work area when you create the report programmatically using the Simulink.sdi.report function.

Compare Pane

By default, the Compare pane shows the signal name, the absolute and relative tolerances used in the signal comparison, and the maximum difference from the comparison result. To display different or additional metadata in the results on the Compare pane, select the check box next to each piece of metadata you want to display in the Table Columns preference in the Compare section. You can always view complete metadata for the signals compared for a selected signal result using the Properties pane, where metadata that differs between the compared signals is highlighted. Signal metadata displayed on the Compare pane does not affect the contents of comparison reports.

Signal Selection on the Inspect Pane

You can configure how you select signals to plot on the selected subplot in the Simulation Data Inspector. By default, you use check boxes next to each signal to plot. You can also choose to plot signals based on selection in the work area. Use Check Mode when creating views and visualizations that represent findings and analysis of a data set. Use Browse Mode to quickly view and analyze data sets with a large number of signals.

For more information about creating visualizations using Check Mode, see Create Plots Using the Simulation Data Inspector.

For more information about using Browse Mode, see Visualize Many Logged Signals.

Note

To use Browse Mode, your layout must include only Time Plot visualizations.

How Signals Are Aligned for Comparison

When you compare runs using the Simulation Data Inspector, the comparison algorithm pairs signals for signal comparison through a process called alignment. You can align signals between the compared runs using one or more of the signal properties shown in the table.

PropertyDescription
Data SourcePath of the variable in the MATLAB workspace for data imported from the workspace
PathBlock path for the source of the data in its model
SID

Simulink® identifier

For more information about SIDs, see Simulink Identifiers

Signal NameName of the signal

You can specify the priority for each piece of metadata used for alignment. The Align By field specifies the highest priority property used to align signals. The priority drops with each subsequent Then By field. You must specify a primary alignment property in the Align By field, but you can leave any number of Then By fields blank.

By default, the Simulation Data Inspector aligns signals between runs according to this flow chart.

For more information about configuring comparisons in the Simulation Data Inspector, see How the Simulation Data Inspector Compares Data.

Colors Used to Display Comparison Results

You can configure the colors used to display comparison results using the Simulation Data Inspector preferences. You can specify whether to use the signal color from the Inspect pane or a fixed color for the baseline and compared signals. You can also choose colors for the tolerance and the difference signal.

By default, the Simulation Data Inspector displays comparison results using fixed colors for the baseline and compared signals. Using a fixed color allows you to avoid the baseline signal color and compared signal color being either the same or too similar to distinguish.

Signal Grouping

To visualize hierarchy within a data set in the Simulation Data Inspector, you can specify how to group signals within a run in the Inspect and Compare panes. The preference applies to both panes such that signals are always grouped the same way on the Inspect and Compare panes.

You can group signals in a run based on model hierarchy or data hierarchy. When you have Simscape™, you can also group signals based on physical system hierarchy. By default, the Simulation Data Inspector groups signals by physical system hierarchy if you have a Simscape license, and by data hierarchy.

Grouping signals adds rows for the hierarchical nodes that you can expand to show the signals within that node. For example, you can group signals within a run by model hierarchy and then by data hierarchy.

By default, all hierarchical nodes within the run are collapsed. You can expand the model node to see the logged signals.

Signals inside subsystem A are collapsed, and the signals in the Mux block output are grouped under Mux: 1. You can expand these groups to see the rest of the signals in the run. The check boxes for signals remain on the left, and the signal names indent to indicate the level of hierarchy.

To remove the hierarchy and display a flat list of signals in each run, select None for all grouping options.

Programmatic Use

To specify how to group signals programmatically, use the Simulink.sdi.setTableGrouping function.

Data to Stream from Parallel Simulations

When you run parallel simulations using the parsim function, you can stream logged simulation data to the Simulation Data Inspector. A dot next to the run name in the Inspect pane indicates the status of the simulation that corresponds to the run, so you can monitor simulation progress while visualizing the streamed data. You can control whether data streams from a parallel simulation based on the type of worker the data comes from.

By default, the Simulation Data Inspector is configured for manual import of data from parallel workers. You can use the Simulation Data Inspector programmatic interface to inspect the data on the worker and decide whether to send it to the client Simulation Data Inspector for further analysis. To manually move data from a parallel worker to the Simulation Data Inspector, use the Simulink.sdi.sendWorkerRunToClient function.

You may want to automatically stream data from parallel simulations that run on local workers or on local and remote workers. Streaming data from both local and remote workers may affect simulation performance, depending on how many simulations you run and how much data you log. When you choose to stream data from local workers or all parallel workers, all logged simulation data automatically shows in the Simulation Data Inspector.

Programmatic Use

You can configure Simulation Data Inspector support for parallel worker data programmatically using the Simulink.sdi.enablePCTSupport function.

Options for Saving and Loading Session Files

You can specify a maximum amount of memory to use while loading or saving a session file. By default, the Simulation Data Inspector uses a maximum of 100 MB of memory when you load or save a session file. You can specify a memory use limit as low as 50 MB.

To reduce the size of the saved session file, you can specify a compression option.

  • None — Do not compress saved data.

  • Normal — Compress the saved file as much as possible.

  • Fastest — Compress the saved file less than Normal compression for faster save time.

Archive Behavior and Run Limit

The Simulation Data Inspector archive stores runs in a collapsible pane, allowing you to manage the contents of the work area without deleting run data. You can configure whether the Simulation Data Inspector automatically moves prior simulation runs to the archive. You can also limit the number of runs stored in the archive.

Manage Runs in the Archive

By default, the Simulation Data Inspector automatically archives simulation runs. When you simulate a model, the prior simulation run moves to the archive, and the Simulation Data Inspector updates the view to show the data for aligned signals in the current run.

The archive does not impose functional limitations on the runs and signals it contains. You can plot signals from the archive, and you can use runs and signals in the archive in comparisons. You can drag runs of interest from the archive to the work area and vice versa whether the Automatically Archive setting is enabled or disabled. To prevent the Simulation Data Inspector from automatically moving prior simulations runs to the archive, clear the Automatically archive setting.

When you import runs into the Simulation Data Inspector, the imported runs appear in the work area, and the Current tag remains on the most recent simulation run. You can import signals to existing runs in the work area and in the archive.

Tip

You can delete the contents of the archive manually using the trash icon.

Limit Data Retention

To reduce the amount of data the Simulation Data Inspector retains, you can configure a limit for the number of runs stored in the archive. When the number of runs in the archive reaches the size limit, the Simulation Data Inspector starts to delete runs on a first-in, first-out basis.

The size limit applies only to runs in the archive. For the Simulation Data Inspector to automatically limit the data it retains by deleting old runs, select Automatically archive and specify a size limit.

By default, the Simulation Data Inspector retains the last 20 runs moved to the archive. To remove the limit, select No limit. To specify the maximum number of runs to store in the archive, select Last n runs and enter the desired limit. The Simulation Data Inspector warns you when you specify a limit that would delete runs already in the archive.

Programmatic Use

Configure the Automatically archive setting programmatically using the Simulink.sdi.setAutoArchiveMode function.

Specify the number of runs to retain in the archive using the Simulink.sdi.setArchiveRunLimit function.

Signal Display Units

Signals in the Simulation Data Inspector have two units properties: stored units and display units. The stored units represent the units of the data saved to disk. The display units specify how the Simulation Data Inspector displays the data. You can configure the Simulation Data Inspector to use a system of units to define the display units for all signals. You can choose either the SI or US Customary system of units, or you can display data using its stored units.

When you use a system of units to define display units for signals in the Simulation Data Inspector, the display units update for any signal with display units that are not valid for that unit system. For example, if you select SI units, the display units for a signal may update from ft to m.

Note

The system of units you choose to use in the Simulation Data Inspector does not affect the stored units for any signal. You can convert the stored units for a signal using the convertUnits function. Conversion may result in loss of precision.

In addition to selecting a system of units, you can specify override units so that all signals of a given measurement type are displayed using consistent units. For example, if you want to visualize all signals that represent weight using units of kg, specify kg as an override unit.

Tip

For a list of units supported by Simulink, enter showunitslist in the MATLAB Command Window.

You can also modify the display units for a specific signal using the Properties pane. For more information, see Modify Signal Properties in the Simulation Data Inspector.

Programmatic Use

Configure the unit system and override units using the Simulink.sdi.setUnitSystem function. You can check the current units preferences using the Simulink.sdi.getUnitSystem function.

See Also

Functions

Related Topics