A Simulink.SimulationOutput
object represents the result of a simulation. The SimulationOutput
object contains simulation metadata and all data logged from simulation. You can modify the contents of a Simulink.SimulationOutput
object by adding or removing data logging and custom properties.
Open the model LoggingBlocks
, which logs several input signals using multiple logging techniques.
The output of the Sine Wave block is logged using signal logging.
The output of the Gain block is logged using a To Workspace block.
The outputs of the Gain, Chirp Signal, and Square Wave Generator blocks are logged using a Record block.
The output of the Square Wave Generator block is logged using output logging.
The model is also configured to log time data.
Use the get_param
function to save the values of the Amplitude and Frequency parameters of the Sine Wave block. Store the values in the structure sinConfig
.
Simulate the model.
The simulation results contain all logging variables created in simulation. Use the who
function to get a list of properties you can modify.
props = 5x1 cell
{'logsout' }
{'recordout'}
{'simout' }
{'tout' }
{'yout' }
For this simulation, suppose you want to save only the data for the signal path related to the Sine Wave block. Use the removeProperty
function to remove the recordout
and yout
properties.
This Simulink.SimulationOutput object contains these editable properties:
logsout simout tout
You can also add data to a Simulink.SimulationOutput
object by adding your own properties to the object or by using the setUserData
function to specify the value for the UserData
property on the Simulink.SimulationMetadata
object.
Suppose you want to save the parameter values for the Sine Wave block as a property on the Simulink.SimulationOutput
object. Add the property SineWaveParameters
by using dot notation the same way you add a field to a structure.
This Simulink.SimulationOutput object contains these editable properties:
SineWaveParameters logsout simout tout