Main Content

get

Access and display values of simulation results

Syntax

output= get(simOut, 'VarName')
output= simOut.get('VarName')

Description

output= get(simOut, 'VarName')accepts one variable name. SpecifyVarNameinside single quotes.

output= simOut.get('VarName')is a syntax with dot notation to accept one variable name.

Tip

A simpler alternative to using the get function is to use dot notation. For example, to access data for thexoutoutput variable, you can use this command:

simOut.xout

Input Arguments

expand all

Simulation object to get metadata from, specified as aSimulationOutputobject.

Name of logged variable for which you seek values.

Output Arguments

Value

Value of the logged variable name specified in input.

Examples

Simulatevdpand 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 thexoutoutput variable, you can use this command:

simOut.xout

Another alternative is to useSimulink.SimulationOutput.whoand thenSimulink.SimulationOutput.find.

See Also

|