How can I disable signal logging for all the signals in my model?
Show older comments
I've instrumented many signals in my Simulink model with the blue wi-fi badge. How can I disable data logging for all signals in my model?
Accepted Answer
More Answers (1)
Keqin Xu
on 3 Nov 2020
Edited: Stefanie Schwarz
on 11 Aug 2025
I made a convenient shortcut out of the following script.
% this will remove logging of any selected signals in the Simulinkmodel
mn=inputdlg({'Input SimuLink Model Name:'},'',1,{''});
if ~isempty(mn)
if exist(mn{1})==4
mdlsignals = find_system(mn,'FindAll','on','LookUnderMasks','all','FollowLinks','on','type','line','SegmentType','trunk');
ph = get_param(mdlsignals,'SrcPortHandle');
for i=1: length(ph)
set_param(ph{i},'datalogging','off')
end
msgbox(['Any signal loggings in "',mn{1},'" have been removed.'])
else
msgbox(['"',mn{1},'" is not a valid Simulink model.'])
end
end
Categories
Find more on Programmatic Model Editing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
