Inspect and compare data and simulation results to validate and iterate model designs
The Simulation Data Inspector visualizes and compares multiple kinds of data.
Using the Simulation Data Inspector, you can inspect and compare time series data at multiple stages of your workflow. This example workflow shows how the Simulation Data Inspector supports all stages of the design cycle:
Run a simulation in a model configured to log data to the Simulation Data Inspector, or import data from the workspace or a MAT-file. You can view and verify model input data or inspect logged simulation data while iteratively modifying your model diagram, parameter values, or model configuration.
Plot signals on multiple subplots, zoom in and out on specified plot axes, and use data cursors to understand and evaluate the data. Create Plots Using the Simulation Data Inspector to tell your story.
Compare individual signals or simulation runs and analyze your comparison results with relative, absolute, and time tolerances. The compare tools in the Simulation Data Inspector facilitate iterative design and allow you to highlight signals that do not meet your tolerance requirements. For more information about the comparison operation, see How the Simulation Data Inspector Compares Data.
Share your findings with others by saving Simulation Data Inspector data and views.
You can also harness the capabilities of the Simulation Data Inspector from the command line. For more information, see Inspect and Compare Data Programmatically.
Simulink® Toolstrip: On the Simulation tab, under Review Results, click Data Inspector.
Click the streaming badge on a signal to open the Simulation Data Inspector and plot the signal.
MATLAB® command prompt: Enter
You can use the Simulation Data Inspector programmatic interface to modify a parameter for the same signal in multiple runs. This example adds an absolute tolerance of
0.1 to a signal in all four runs of data.
First, clear the workspace and load the Simulation Data Inspector session with the data. The session includes logged data from four simulations of a Simulink® model of a longitudinal controller for an aircraft.
Simulink.sdi.getRunCount function to get the number of runs in the Simulation Data Inspector. You can use this number as the index for a for loop that operates on each run.
count = Simulink.sdi.getRunCount;
Then, use a for loop to assign the absolute tolerance of
0.1 to the first signal in each run.
for a = 1:count runID = Simulink.sdi.getRunIDByIndex(a); aircraftRun = Simulink.sdi.getRun(runID); sig = getSignalByIndex(aircraftRun,1); sig.AbsTol = 0.1; end
Simulink.sdi.view opens the Simulation Data Inspector from the
MATLAB command line.