モデル上の全ての信号線に、信号ロギングのチェックを自動で付けることができますか?
11 views (last 30 days)
Show older comments
MathWorks Support Team
on 6 Jun 2018
Answered: MathWorks Support Team
on 7 Jun 2018
規模の大きくないモデルを検討しており、モデル上の全ての信号線に信号ロギングのチェックを自動で付けたいと考えています。マウス操作で行うよりも手間のかからない、何か良い方法はあるか、教えて下さい。
Accepted Answer
MathWorks Support Team
on 6 Jun 2018
MATLAB コマンドウィンドウもしくは MATLAB ファイルとして、自動化の記述をして実行する方法が考えられます。
記述例を下記に示しますので、確認をすることができます。
%%ブロックの探索
blks = find_system(gcs,'LookUnderMasks','all','Type','Block');
N = length(blks);
%%全ブロックについてループにて処理する
for n=1:N
tmp = get_param(blks{n},'PortHandles');
% out 端のあるものについて...
if isempty(tmp.Outport) == 0
M = length(tmp.Outport) % ・・・ out 端の個数
for m = 1:M
set_param(tmp.Outport(m),'Name',['sig' num2str(n) '_' num2str(m)]); % 信号名を例えばこのように自動で付ける
set_param(tmp.Outport(m),'DataLogging','on'); % 信号のログ チェックを ON にする
end
end
end
0 Comments
More Answers (0)
See Also
Categories
Find more on モデルの入力と出力の準備 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!