Simulink turn off data logging

S
Samantha · Jul 10, 2020 · 5.2K views
Question
Hello ! I do have the following problem: I have a very big simuling model, with a lot of subsystems. In this model a lot of signal have already logged. I'm making a test environment to run this model, and I have to test the result of the simulation. I have to log only a few data, but in the model there are approximately 150 logged signal (and it's made the simulation much slower). So for that, in my test environment I'd like to unlog all of the signal, and turn on only witch are necessary for me.
Expert Answer
Profile picture of Neeta Dsouza
Neeta Dsouza PhD Expert
Answered Aug 22, 2026

Disable all logging at once

 

% Find all ports with data logging enabled
pH = find_system('YourModelName', 'FindAll', 'on', 'Type', 'Port', 'DataLogging', 'on');

% Disable all logging
for x=1:length(pH)
   set_param(pH(x), 'DataLogging', 'off');
end
Have a different question? Ask here

Get a Free Consultation or a Sample Assignment Review!