%% Simulate 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.
% Copyright 2015 The MathWorks, Inc.