フィルターのクリア

prevent creating workspace variables

5 ビュー (過去 30 日間)
Leif
Leif 2013 年 10 月 24 日
コメント済み: Leif 2013 年 11 月 8 日
Question: Is there a way (e.g. a command) to prevent Simulink generally to write data to workspace even if the scopes checkboxes are selected ?
Explanation: If you have a complex System with many signals and states you also need a lot of scopes and if you want to evaluate the signals in MATLAB you also need to save a lot of data into workspace. That slows down the computer.
For only to quickly see the change of a singe parameter you want a fast simulation, but unchecking all scope's boxes takes too long.

回答 (2 件)

John Barber
John Barber 2013 年 10 月 24 日
Try this:
h = find_system(bdroot,'BlockType','Scope');
for k = 1:length(h)
set_param(h{k},'SaveToWorkspace','off');
end
You could turn this into a function, and to get fancy, could have it toggle the value by reading the current parameter value for each scope block, then setting it to the opposite. In this way, you could just call the function at the command line to toggle the data export on or off.
Note that you may need to add some options to the find_system() call if you have scopes inside of masked subsystems or things like that. See the help doc for find_system for details.
  1 件のコメント
Leif
Leif 2013 年 11 月 8 日
This works fine for me on the top level, but it won't work for my subsystems even if I type
h = find_system('System1/MySubSys1','BlockType','Scope');
or
h = find_system(bdroot,'BlockType','Scope','LookUnderMasks','all');

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


Vishal Rane
Vishal Rane 2013 年 10 月 28 日
Have you checked explored these options?
  1 件のコメント
Leif
Leif 2013 年 10 月 28 日
None of the boxes is checked in my case

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

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by