Main Content

Save and Share Simulation Data Inspector Data and Views

After you inspect, analyze, or compare your data in the Simulation Data Inspector, you can share your results with others. The Simulation Data Inspector provides several options for sharing and saving your data and results depending on your needs. With the Simulation Data Inspector, you can:

  • Save your data and layout modifications in a Simulation Data Inspector session.

  • Share your layout modifications in a Simulation Data Inspector view.

  • Share images and figures of plots you create in the Simulation Data Inspector.

  • Create a Simulation Data Inspector report.

  • Export data to the workspace.

  • Export data to a file.

Save and Load Simulation Data Inspector Sessions

If you want to save or share data along with a configured view in the Simulation Data Inspector, save your data and settings in a Simulation Data Inspector session. You can save sessions as MAT or MLDATX files. The default format is MLDATX. When you save a Simulation Data Inspector session, the session file contains:

  • All runs, data, and properties from the Inspect pane, including which run is the current run and which runs are in the archive

  • Plot display selection for signals in the Inspect pane

  • Subplot layout and line style and color selections

  • Current signal or run comparison in the Comparison pane

Note

Comparison results and global tolerances are not saved in Simulation Data Inspector sessions.

To save a Simulation Data Inspector session:

  1. Pause on the save icon on the left side bar. Then, click Save As.

  2. Name the file.

  3. Browse to the location where you want to save the session, and click Save.

    For large datasets, a status overlay in the bottom right of the graphical viewing area displays information about the progress of the save operation and allows you to cancel the save operation.

The Save tab of the Simulation Data Inspector preferences menu on the left side bar allows you to configure options related to save operations for MLDATX files. You can set a limit as low as 50 MB on the amount of memory used for the save operation. You can also set Compression to one of these options:

  • None, the default, applies no compression during the save operation.

  • Normal creates the smallest file size.

  • Fastest creates a smaller file size than you would get by selecting None, but provides a faster save time than Normal.

To load a Simulation Data Inspector session, click the open icon on the left side bar. Then, browse to select the MLDATX file you want to open, and click Open.

Alternatively, you can double-click the MLDATX file. MATLAB® and the Simulation Data Inspector open if they are not already open.

When the Simulation Data Inspector already contains runs, loading a session file opens the Open Session dialog box. Using the Open Session dialog box, you can choose to:

  • Delete existing runs from the Simulation Data Inspector and add data from the session file to the workspace.

  • Keep existing data in the Simulation Data Inspector and add data from the session file to the archive.

In both cases, the view updates to show plotted signals from the session file. You can drag runs between the work area and archive as desired.

When the Simulation Data Inspector does not contain runs and you open a session, the Simulation Data Inspector puts runs in the work area and archive as specified in the file.

Share Simulation Data Inspector Views

When you have different sets of data that you want to visualize the same way, you can save a view. A view saves the layout and appearance characteristics of the Simulation Data Inspector without saving the data. Specifically, a view saves:

  • Plot visualization type, layout, axis ranges, linking characteristics, and normalized axes

  • Location of signals in the plots, including plotted signals in the archive

  • Signal grouping and columns on display in the Inspect pane

  • Signal color and line styling

To save a view:

  1. Click Visualizations and layouts .

  2. In Saved Views, click Save current view.

  3. In the dialog box, specify a name for the view and browse to the location where you want to save the MLDATX file.

  4. Click Save.

To load a view:

  1. Click Visualizations and layouts .

  2. In Saved Views, click Open saved view.

  3. Browse to the view you would like to load, and click Open.

Share Simulation Data Inspector Plots

Use the snapshot feature to share the plots you generate in the Simulation Data Inspector. You can export your plots to the clipboard to paste into a document, as an image file, or to a MATLAB figure. You can choose to capture the entire plot area, including all subplots in the plot area, or to capture only the selected subplot.

Click the camera icon on the toolbar to access the snapshot menu. Use the radio buttons to select the area you want to share and how you want to share the plot. After you make your selections, click Snapshot to export the plot.

The default Snapshot menu.

If you create an image, select where you would like to save the image in the file browser.

You can also create snapshots of your plots in the Simulation Data Inspector programmatically using Simulink.sdi.snapshot.

Create Simulation Data Inspector Report

To quickly generate documentation of your results, create a Simulation Data Inspector report. You can create a report of your data in either the Inspect or the Compare pane. The report is an HTML file that includes information about all the signals and plots in the active pane. The report includes all signal information displayed in the signal table in the navigation pane. For more information about configuring the table, see Inspect Metadata.

To generate a Simulation Data Inspector Report:

  1. Click the create report icon on the left bar.

    • When you create a report while viewing the Inspect pane, the report includes the plots and signals from the Inspect pane.

      The default Report dialog box for a report of the Inspect pane

    • When you create a report while viewing the Compare pane, the report includes the data and plots from the Compare pane. When you generate a comparison report, you can select Report only mismatched signals or to Report all signals. If you select Report only mismatched signals, the report shows only signal comparisons that are not within the specified tolerances.

      The default Report dialog box for a report of the Compare pane

  2. In the File text box, specify a filename and location of where you want to save the report.

  3. Under Options, you can choose whether to prevent overwriting files and whether to use shortened block paths in the report.

  4. Click Create.

    The generated report automatically opens in your default browser.

Export Data to Workspace or File

You can use the Simulation Data Inspector to export data to the base workspace, a MAT file, or a Microsoft® Excel® file. You can export a selection of runs and signals, runs in the work area, or all runs in the Inspect pane, including the Archive.

When you export a selection of runs and signals, make the selection of data to export before clicking the export button .

Only the selected runs and signals are exported. In this example, only the x1 signals from Run 1 and Run 2 are exported. The check box selections for plotting data do not affect whether a signal is exported.

The Inspect pane shows Run 1 and Run 2 each with signals x1 and x2. The check boxes for signals x1 and x2 from Run 1 and signal x2 from Run 2 are selected. The x1 signals from Run 1 and Run 2 are selected while holding the SHIFT key and appear highlighted. Only the x1 signals are exported

When you export a single signal to the workspace or a MAT file, the signal is exported to a timeseries object. Data exported to the workspace or a MAT file for a run or multiple signals is stored as a Simulink.SimulationData.Dataset object.

To export data to a file, in the Export dialog box, select File. You can specify a filename and browse to the location where you want to save the exported file. When you export data to a MAT file, a single exported signal is stored as a timeseries object, and runs or multiple signals are stored as a Simulink.SimulationData.Dataset object. When you export data to a Microsoft Excel file, the data is stored using the format described in Microsoft Excel Import, Export, and Logging Format.

To export to a Microsoft Excel file, for File, select the XLSX extension. When you export data to a Microsoft Excel file, you can specify additional options for the format of the data in the exported file. If the filename you provided already exists, you can choose to overwrite the entire file or to only overwrite sheets containing data that corresponds to the exported data. You can also choose which metadata to include and whether signals with identical time data share a time column in the exported file.

Export Video Signal to MP4 File

You can export a 2-D or 3-D signal that contains RGB or monochrome video data to an MP4 file using the Simulation Data Inspector. For example, when you log a video signal in a simulation, you can export the data to an MP4 file and view the video using a video player. To export a video signal to an MP4 file:

  1. Select the signal you want to export.

  2. Click Export in the toolbar on the left, or right-click the signal and select Export.

  3. In the Export dialog box, for Export, select Selected runs and signals. For To, select File.

  4. Specify a filename and the path to the location where you want to save the file.

  5. From the list, select MP4 video file, then click Export.

For the option to export to an MP4 file to be available:

  • You must export only one signal at a time.

  • The selected signal must be 2-D or 3-D and contain RGB or monochrome video data.

  • The selected signal must be represented in the Simulation Data Inspector as a single signal with multidimensional sample values.

    You may need to convert the signal representation before exporting the signal data. For more information, see Analyze Multidimensional Signal Data.

  • The data type for the signal values must be double, single, or uint8.

Exporting a video signal to an MP4 file is not supported for Linux® operating systems.

See Also

Functions

Related Topics