Simulink turn off data logging

114 Ansichten (letzte 30 Tage)
Peter Kerekes
Peter Kerekes am 28 Mai 2018
Kommentiert: Jinggang am 9 Jul. 2024
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.

Akzeptierte Antwort

TAB
TAB am 28 Mai 2018
Bearbeitet: TAB am 28 Mai 2018
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
  2 Kommentare
Peter Kerekes
Peter Kerekes am 28 Mai 2018
Bearbeitet: Peter Kerekes am 28 Mai 2018
Thank you, it's working, but somehow it can't find the all logged signal. It found 26 of 148.
Sina Sharifi
Sina Sharifi am 2 Jul. 2020
Bearbeitet: Sina Sharifi am 2 Jul. 2020
Hi
I had a similar problem.
These lines solved it. Thank you.
Sina

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (2)

Paul Smith
Paul Smith am 31 Jan. 2019
I had a similar issue, I ended up modifying to this though:-
pH = find_system('Your Model name','LookUnderMasks','all','FindAll', 'on', 'DataLogging', 'on');
'Type', 'Port'
Having type and port in the search misses other potentially logable terms.

Zhu
Zhu am 26 Jul. 2019
Turn this model into .mdl format
Open model in text
Find all "datalogging on", set it to off
Done!
  3 Kommentare
Herman Wong
Herman Wong am 7 Mär. 2024
Bearbeitet: Herman Wong am 7 Mär. 2024
set_param(bdroot, 'InstrumentedSignals', []) --- awesome! Thanks Jun Yang!
Jinggang
Jinggang am 9 Jul. 2024
Thank u Jun Tang, it works!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Prepare Model Inputs and Outputs finden Sie in Help Center und File Exchange

Produkte


Version

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by