Plot simulation results in Simulation Data Inspector
plot( plots the simulation results in
simRes in the Simulation Data
Inspector and opens the Simulation Data Inspector. You can use the
plot function to plot simulation results stored in these objects:
When the input object contains fewer than eight signals, the Simulation Data Inspector
layout changes to
1-by-n, where n
is the number of signals, and each subplot displays one signal. When the simulation results
contain more than eight signals to plot, the Simulation Data Inspector layout changes to
1, and the plot displays the first signal.
When some or all of the data in a
Simulink.SimulationOutput object is
in a Simulation Data Inspector run, the
plot function opens the
Simulation Data Inspector and plots all the signals in the run. When the
SimulationOutput object does not correspond to a run in the Simulation
Data Inspector, the
plot function imports the data into a new
When you use the
plot function to plot a single signal, the
plot function always imports the data for the signal into a new
These objects also have plot functions that plot data in the Simulation Data Inspector:
runObj = plot(
Simulink.sdi.Run object that corresponds to
the plotted data.
Plot Simulation Output Data
ex_vdp_simout_plot is configured to log signals, outputs, and states and return all logged data as a single simulation output. You can use the
plot function to plot the simulation results in the Simulation Data Inspector.
Simulate the model. The model logs data using the
Dataset format, so all the logged data streams to the Simulation Data Inspector during simulation.
open_system('ex_vdp_simout_plot') out = sim('ex_vdp_simout_plot');
plot function to plot all the simulation results in the Simulation Data Inspector. The Simulation Data Inspector updates to a
8 layout and plots one signal on each subplot.
You can also use the
plot function to plot data for a single signal or a subset of the simulation results. When you plot the data for a single signal, the Simulation Data Inspector always imports the data for the signal into a new run.
Simulink.SimulationOutput object contains a property for each logging variable. Access the signal logging data in the property
logsout = out.logsout;
Then, use the
get function for the
Dataset object to access the data for the first element, which contains the data for a single logged signal.
sig1 = get(logsout,1);
When you plot the data for the signal, the Simulation Data Inspector imports the signal into a new run, updates the layout to
1, and plots the signal.
simRes — Object that contains simulation data to plot
Object that contains simulation data plot, specified in one of these forms:
sltest.Assessment(Simulink Test) object
plot(out) plots the contents of the
out in the
Simulation Data Inspector and opens the Simulation Data Inspector.
runObj — Run that corresponds to plotted data
Run that corresponds to plotted data, returned as a
Introduced in R2019b