get
Access and display values of simulation results
Syntax
output
= get(simOut, 'VarName
')output
= simOut.get('VarName
')
Description
accepts one variable name. Specifyoutput
= get(simOut
, 'VarName
')VarName
inside single quotes.
is a syntax with dot notation to accept one variable name.output
= simOut.get('VarName
')
Tip
A simpler alternative to using the get function is to use dot notation. For example, to access data for thexout
output variable, you can use this command:
simOut.xout
Input Arguments
Output Arguments
|
Value of the logged variable name specified in input. |
Examples
Simulatevdp
and store the values of the variableyoutNewinyout.
simOut = sim('vdp','SimulationMode','rapid','AbsTol','1e-5',... 'SaveState','on','StateSaveName','xoutNew',... 'SaveOutput','on','OutputSaveName','youtNew'); yout = simOut.get('youtNew')
Alternatives
A simpler alternative is to use dot notation. For example, to access data for thexout
output variable, you can use this command:
simOut.xout
Another alternative is to useSimulink.SimulationOutput.who
and thenSimulink.SimulationOutput.find
.