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. Specify VarName inside 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 the xout output variable, you can use this command:

simOut.xout

Input Arguments

expand all

Simulation object to get metadata from, specified as a SimulationOutput object.

Name of logged variable for which you seek values.

Output Arguments

Value

Value of the logged variable name specified in input.

Examples

Simulate vdp and store the values of the variable youtNew in yout.

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 the xout output variable, you can use this command:

simOut.xout

Another alternative is to use Simulink.SimulationOutput.who and then Simulink.SimulationOutput.find.

See Also

|