Simulink.SimulationOutput
Access simulation results
Description
TheSimulink.SimulationOutput
object includes all logged simulation data and aSimulationMetadata
object that describes simulation conditions. TheSimulink.SimulationOutput
object also contains useful metadata about the simulation, simulation run time. You can use theSimulink.SimulationOutput
object to inspect results of the simulation, and you can use theplot
function on theSimulink.SimulationOutput
object to visualize the results. For simulation invoked using theRunorStep Forwardbuttons in Simulink, theSimulink.SimulationOutput
object is stored in the base workspace, with the name specified in the model parameters.Simulink.SimulationOutput
is writeable.
Creation
By default, each simulation you run, creates aSimulink.SimulationOutput
object that contains all data logged in the simulation, and aSimulink.SimulationMetadata
object with the simulation metadata. You can access theSimulationOutput
objects in several ways.
The
Simulink.SimulationOutput
object returns the logged data for the simulation.You can use
who
,get
, andfind
方法访问输出variable names and their respective values.
In theConfiguration Parameters, the model settingSingle simulation output, controls whether simulation output is returned in aSimulink.SimulationOutput
object or if data is expanded in the base workspace. You can also use the command line API for this behavior by settingReturnWorkspaceOutputs
toon
as a name-value argument pair with thesim
command.
Properties
Object Functions
find | Access and display values of simulation results |
get | Access and display values of simulation results |
getSimulationMetadata | ReturnSimulationMetadata 为模拟对象 |
setUserData | Store custom data inSimulationMetadata object thatSimulationOutput object contains |
setUserString | Store custom character vector inSimulationMetadata object inSimulationOutput object |
who | Access and display output variable names of simulation |
plot | Plot simulation output data in the Simulation Data Inspector |