Simulink.SimulationOutput class

Package: Simulink

Access object values of simulation results

Description

The SimulationOutput class contains all simulation outputs, including workspace variables.

Use Simulink.SimulationOutput.who and either Simulink.SimulationOutput.get or Simulink.SimulationOutput.find methods to access the output variable names and their respective values.

Methods

find Access and display values of simulation results
get Access and display values of simulation results
who Access and display output variable names of simulation

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB® Programming Fundamentals documentation.

Examples

Simulate the vdp model and place the results of the Simulink.SimulationOutput object in simOut.

simOut = sim('vdp','SimulationMode','rapid','AbsTol','1e-5',...
                     'SaveState','on','StateSaveName','xoutNew',...
                     'SaveOutput','on','OutputSaveName','youtNew');

Store the variable names of the outputs in simOutVars, using the who method.

simOutVars = simOut.who

Simulink returns and displays:

simOutVars = 

    'xoutNew'
    'youtNew'

Get the values of the variable youtNew.

yout = simOut.get('youtNew')

Simulink returns and displays the values.

Was this topic helpful?