MATLAB: Simulink turn off data logging

data loggingsimulink

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.

Best Answer

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