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
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. Sessions are saved as MLDATX files. 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
Subplot layout, visualization choices, and plotted signals in the Inspect pane
Current signal or run comparison in the Comparison pane
Subplot customizations such as axis limits, grid lines, and legend position
Plotted signal customizations such as line style and color selections
To save a Simulation Data Inspector session:
Click the save icon on the left side bar to open the Save Session dialog box.
In the Save Session dialog box, you can name the session file, specify the MLDATX file version, and set Compression to one of these options:
Balanced for size and speed
creates a file that is balanced between the speed ofFastest
and the file size ofCompact
.Fastest
, the default, creates a smaller file size than an uncompressed file, with a comparable save speed.Compact
creates the smallest file size.None
does not compress the file. This option creates the largest file size but has the fastest save time.
Click Save or press Ctrl+S to save your session file. For large data sets, 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.
To save a previously saved session with a new filename or to change the version or compression options, pause on the save icon on the left side bar. Then, click Save As.
Note
After you initially save a session, clicking the Save button
or pressing Ctrl+S saves the session as an MLDATX version 2.0
file using the default compression Fastest
. To maintain
compression and version options other than the defaults, click the Save
As button.
To load a Simulation Data Inspector session:
Click the open icon on the left side bar.
Browse to select the MLDATX file you want to open.
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:
Click Visualizations and layouts .
In Saved Views, click Save current view.
In the dialog box, specify a name for the view and browse to the location where you want to save the MLDATX file.
Click Save.
To load a view:
Click Visualizations and layouts .
In Saved Views, click Open saved view.
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.
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:
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.
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.
In the File text box, specify a filename and location of where you want to save the report.
Under Options, you can choose whether to prevent overwriting files and whether to use shortened block paths in the report.
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.
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:
Select the signal you want to export.
Click Export in the toolbar on the left, or right-click the signal and select Export.
In the Export dialog box, for Export, select Selected runs and signals. For To, select File.
Specify a filename and the path to the location where you want to save the file.
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
, oruint8
.
Exporting a video signal to an MP4 file is not supported for Linux® operating systems.