Simulink turn off data logging

121 ビュー (過去 30 日間)
Peter Kerekes
Peter Kerekes 2018 年 5 月 28 日
編集済み: Herman Wong 2024 年 3 月 7 日
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.

採用された回答

TAB
TAB 2018 年 5 月 28 日
編集済み: TAB 2018 年 5 月 28 日
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 件のコメント
Peter Kerekes
Peter Kerekes 2018 年 5 月 28 日
編集済み: Peter Kerekes 2018 年 5 月 28 日
Thank you, it's working, but somehow it can't find the all logged signal. It found 26 of 148.
Sina Sharifi
Sina Sharifi 2020 年 7 月 2 日
編集済み: Sina Sharifi 2020 年 7 月 2 日
Hi
I had a similar problem.
These lines solved it. Thank you.
Sina

サインインしてコメントする。

その他の回答 (2 件)

Paul Smith
Paul Smith 2019 年 1 月 31 日
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 2019 年 7 月 26 日
Turn this model into .mdl format
Open model in text
Find all "datalogging on", set it to off
Done!
  2 件のコメント
Jun Yang
Jun Yang 2023 年 11 月 20 日
this command works in a better way!
set_param(bdroot, 'InstrumentedSignals', [])
Herman Wong
Herman Wong 2024 年 3 月 7 日
編集済み: Herman Wong 2024 年 3 月 7 日
set_param(bdroot, 'InstrumentedSignals', []) --- awesome! Thanks Jun Yang!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by