Documentation

Contents

sim

Class: sdo.SimulationTest
Package: sdo

Simulate Simulink model using simulation scenario

Syntax

sim_out = sim(sim_obj)

Description

sim_out = sim(sim_obj) simulates a Simulink® model using a simulation scenario.

Tips

  • Before simulating the model, specify the parameter values and signals to log in the Parameters and LoggingInfo properties of the sim_obj. The software restores the parameter values and logging settings to their original values after simulation.

Input Arguments

sim_obj

sdo.SimulationTest object

Output Arguments

sim_out

sdo.SimulationTest object which contains the logged data in the LoggedData property.

Examples

Simulate a model and log model signal during simulation.

Log model signals.

Pressures = Simulink.SimulationData.SignalLoggingInfo;
Pressures.BlockPath       = 'sdoHydraulicCylinder/Cylinder Assembly';
Pressures.OutputPortIndex = 1;
simulator = sdo.SimulationTest('sdoHydraulicCylinder');
simulator.LoggingInfo.Signals = [Pressures];

Specify parameter values.

Ac = sdo.getParameterFromModel('sdoHydraulicCylinder','Ac');
Ac.Value = 0.5;
simulator.Parameters = Ac;

Simulate the model.

sim_obj = sim(simulator);

The specified signal Pressure is logged during simulation.

Was this topic helpful?