To turn off data logging in Simulink, open Model Configuration Parameters (Ctrl + E) → Data Import/Export and uncheck the boxes for Time, States, Output, and Signal logging. To disable data logging programmatically across batch simulations or Monte Carlo runs, execute set_param(modelName, 'SignalLogging', 'off', 'SaveTime', 'off', 'SaveOutput', 'off') in the MATLAB Command Window.
Method 1: Programmatic Automation via MATLAB Code (Fastest)
Disabling logging programmatically is ideal when running automated scripts, parameter sweeps, or optimization loops where logging data to workspace variables (tout, yout, logsout) consumes RAM and slows down solver execution:
% Define your Simulink model name (without .slx extension)
modelName = 'my_simulink_model';
load_system(modelName); % Load model into memory without opening canvas
% Turn off all standard workspace logging parameters
set_param(modelName, 'SaveTime', 'off'); % Disables 'tout'
set_param(modelName, 'SaveOutput', 'off'); % Disables 'yout'
set_param(modelName, 'SaveState', 'off'); % Disables 'xout'
set_param(modelName, 'SaveFinalState', 'off'); % Disables final state logging
set_param(modelName, 'SignalLogging', 'off'); % Disables 'logsout' (Signal Logging)
set_param(modelName, 'DSIRecordToWorkspace', 'off'); % Disables Simulation Data Inspector recording
% Save changes to model
save_system(modelName);
fprintf('Data logging successfully turned off for model: %s\n', modelName);
Method 2: Graphical Interface (Simulink Canvas GUI)
If you prefer using the graphical editor:
- Open your Simulink model.
- Press
Ctrl + E(or navigate to the Modeling tab → click the gear icon Model Settings). - In the left sidebar, click Data Import/Export.
- Under the Save to workspace or file section, uncheck the following boxes:
- Time (stops generating
tout) - States (stops generating
xout) - Output (stops generating
yout) - Final states (stops generating
xFinal) - Signal logging (stops generating
logsout)
- Time (stops generating
- Click Apply and OK, then save the model (
Ctrl + S).
Method 3: Turning Off Individual Signal Logging Badges on Wires
If specific signal wires have blue antenna/signal logging badges displayed on the canvas:
% Remove logging flag from all individual signal lines programmatically
lines = find_system(modelName, 'FindAll', 'on', 'Type', 'line');
for i = 1:length(lines)
if strcmp(get_param(lines(i), 'DataLogging'), 'on')
set_param(lines(i), 'DataLogging', 'off');
end
end
Alternatively, right-click the signal wire on the canvas and click Log Selected Signals to toggle it off.
Method 4: Disabling Scope Block Data Logging
Scope blocks can independently record data to the MATLAB workspace. To disable logging inside a Scope:
- Double-click the Scope block to open it.
- Click the Configuration Properties (Gear icon) → select the Logging tab.
- Uncheck Log data to workspace.
- Click OK.
Simulink Data Logging Parameters Reference
| Parameter Name | Default Variable | Effect When Turned Off |
|---|---|---|
SaveTime |
tout |
Stops saving time-step vectors to the base workspace. |
SaveOutput |
yout |
Stops recording Outport block outputs. |
SaveState |
xout |
Stops saving continuous and discrete integrator states. |
SignalLogging |
logsout |
Disables dataset logging on all flagged signal lines. |
DSIRecordToWorkspace |
sdi |
Prevents automatic streaming to the Simulation Data Inspector. |
Performance Benefits of Turning Off Logging
- Faster Simulation Speed: Prevents the Simulink engine from spending CPU cycles copying matrix buffers to MATLAB workspace memory at every integration time step.
- Eliminates Out-Of-Memory Errors: Running long simulation horizons (e.g., thousands of seconds with microsecond step sizes) will not exhaust system RAM.
- Cleaner Workspace: Prevents unexpected variable overwrites in batch script loops.
Need a Custom Version or Complete Simulation for This Problem?
Our 500+ PhD engineers build, debug, and optimize working MATLAB scripts and Simulink (.slx) models tailored to your exact assignment rubrics with zero plagiarism.
Explore similar technical troubleshooting questions and verified MATLAB solutions: