simulink怎么取消所有的信号记录

本文最后更新于 2024年4月15日。

I have enabled data logging for a lot of signals in my model, how can do this via command line functions?

The following code will disable signal logging for all the signals in the model (‘gcs’ can be replaced by the model name):

mdlsignals = find_system(gcs,'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

原文:
https://ww2.mathworks.cn/matlabcentral/answers/409966-how-can-i-disable-data-logging-for-all-the-signals-in-my-model