Signal logging
R2026bOption to log data for signals marked for logging in model
Model Configuration Pane: Data Import/Export
Description
The Signal logging parameter specifies whether the simulation logs data for signals marked for logging in the model. When you enable signal logging, the data logs to the workspace and the Simulation Data Inspector.
By default, the data logs to a property of the
Simulink.SimulationOutput object with the name
logsout. To access the logged signal data, use dot notation. For
example, when you use the default output variable name
out and the default signal-logging variable name
logsout, access the signal data using this command.
logsout = out.logsout;
Settings
on (default) | offonThe simulation logs data for signals marked for logging in the model to the workspace and the Simulation Data Inspector.
By default, the property of the
Simulink.SimulationOutputobject that contains the logged signal data has the namelogsout. To log data to a property with a different name, enter the name in the box. The name must be a valid MATLAB® variable name and must not match the name of any object functions or properties of theSimulink.SimulationOutputobject. For more information, see Variable Names.Signal logging always saves data using the
Datasetformat.Data for variable-size signals is saved as a
timetablethat contains a cell array of values for each time step.offThe simulation does not log signal data during simulation, even if signals are marked for logging in the model.
Tips
If you select Signal logging, you can use the Configure Signals to Log button to open the Signal Logging Selector. You can use the Signal Logging Selector to:
Review all signals in a model hierarchy that are configured for logging.
Override signal logging settings for specific signals.
Control signal logging throughout a model reference hierarchy.
You can use the Signal Logging Selector for both Simulink® and Stateflow® signals.
For details about the Signal Logging Selector, see View Logging Configuration Using the Signal Logging Selector and Override Signal Logging Settings.
For information about logging Simscape™ data, see About Simscape Data Logging (Simscape).
Programmatic Use
Parameter: SignalLogging |
| Type: string | character vector |
Value:
"on" | "off" |
Default:
'on' |
Parameter: SignalLoggingName |
| Type: string | character vector |
| Value: valid MATLAB variable name |
Default:
'logsout' |
Limitations
Signal logging is not supported for:
Signals inside Stateflow charts for rapid accelerator simulations
Input signals of function-call subsystems, if-action subsystems, or switch case action subsystems
Input signals for Merge blocks
Outputs of Function-Call Generator blocks
Outputs of Trigger and Enable blocks
Buses inside for-each subsystems
Signals in referenced models inside for-each subsystems when:
The model that contains the for-each subsystem simulates in rapid accelerator mode.
The for-each subsystem is inside a referenced model simulated in accelerator mode.
For more information about logging signals in for-each subsystems, see Log Signals in For-Each Subsystems.
State port outputs of Integrator and Discrete-Time Integrator blocks.