Documentation

Share Simulation Data Inspector Data and Views

After you have inspected, analyzed, or compared data in the Simulation Data Inspector, you might want to share it with others. You can share information from the Simulation Data Inspector in multiple ways:

  • Export runs or comparisons data to a MAT-file

  • Save all runs data, comparisons data, and plot states to a session MAT-file

  • Share the Simulation Data Inspector view so that others can view data using the same layout

  • Create and copy images of plots

  • Send plots to a MATLAB® figure

Save and Load a Simulation Data Inspector Session

If you have signal data in the Simulation Data Inspector and you want to archive or share the data, save the Simulation Data Inspector session. When you save a Simulation Data Inspector session, the MAT-file contains:

  • All runs, signal data, and properties from the Runs and Comparisons panes

  • Check box selection state for signals in the Runs pane (the view is not saved)

Save Session to a MAT-File

  1. On the Visualize tab, click Save.

  2. Browse to where you want to save the MAT-file to, name the file, and click Save.

Load a Saved Simulation Data Inspector Session

  1. On the Visualize tab, click Open.

  2. Browse, select the MAT-file saved from the Simulation Data Inspector, and click Open.

    Data stored in the MAT-file appears in the Runs pane of the Simulation Data Inspector.

  3. If signal data in the session is plotted on multiple subplots, on the Visualize tab, click Subplots and select the subplot layout.

Export Signal Data from the Simulation Data Inspector

You can use the Simulation Data Inspector to export data from the Runs or Comparisons pane to the base workspace or a MAT-file. When you export data from the Simulation Data Inspector, the MAT-file contains:

  • Signal data

  • Signal names

  • Units of measure (supported by Simscape™)

  • Interpolation method

  • Block path (when you export multiple signals)

  • Port index (when you export multiple signals)

Only highlighted runs and signals from the Runs or Comparisons panes are exported. For example, in the figure, only x1 from Run 1 and Run 2 are exported because they are both highlighted. The check box selection does not affect whether signal data is exported.

Export Data to the Base Workspace

  1. Highlight the signals or runs you want to export from the Runs or Comparisons panes. Use Ctrl+Click to select more than one item.

  2. On the Visualize tab, click Export.

  3. Select Export data to base workspace, and specify the variable name.

  4. Click Export.

Export Data to a MAT-File

  1. Highlight the signals or runs you want to export from the Runs or Comparisons panes. Use Ctrl+Click to select more than one item.

  2. On the Visualize tab, click Export.

  3. Select Export data to MAT-file.

  4. Browse to a file location, specify the file name, and click Save.

  5. Click Export.

Share Simulation Data Inspector Data Views

If you have different data sets from a model, but you want to visualize them in the same way, then you can use views. A view saves the layout of the Simulation Data Inspector. However, a view does not save signal data contained in the Simulation Data Inspector. Specifically, a view saves:

  • Number of plots, axis ranges, linked plots, normalized axis, signal marker selection

  • Location of signals in the plots

  • Signal grouping and columns on display in the Runs pane

  • Signal color and line styling

You can control views from the Saved Views button in the Simulation Data Inspector Visualize tab. As an example, here is a layout of the Simulation Data Inspector with signal data plotted.

If you want to share how the data appears with someone who has different signal data from the model, then save the view and share it. To save the view, click the Saved Views button arrow on the toolstrip, and select Save View. Save the view to a .mldatx file.

Here is different layout with different signal data that someone else generated, which is from the same model, but you want to view it as it appears in the saved view.

To load the saved view, click the Saved Views button. Select the saved view and open it. Now the new data appears in the same way as the original layout.

Create Images of Plots

If you want to share an image of all the plots in the Simulation Data Inspector, then you can use the Copy All Plots button on the Visualize or the Copy Plot button on the Compare tab.

When you click the button, an image of the plot is copied to your clipboard, and you can paste the image into a program, such as Microsoft® PowerPoint® or Microsoft Word. If you want to copy a single plot image to the clipboard, then right-click the plot and select Copy Plot.

Create MATLAB Plots

If you need to plot Simulation Data Inspector data in a MATLAB figure, then you can use the Send to Figure button. On the Visualize or Compare tab, click Send to Figure. All of the plots in the current plot area are sent to the figure.

For more information on plotting and customizing your MATLAB data plots, see Common Graphics Functions in MATLAB.

Related Examples

Was this topic helpful?