モデル上の全ての信号線に、信号ロギングのチェックを自動で付けることができますか?
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
MathWorks Support Team
le 6 Juin 2018
Réponse apportée : MathWorks Support Team
le 7 Juin 2018
規模の大きくないモデルを検討しており、モデル上の全ての信号線に信号ロギングのチェックを自動で付けたいと考えています。マウス操作で行うよりも手間のかからない、何か良い方法はあるか、教えて下さい。
Réponse acceptée
MathWorks Support Team
le 6 Juin 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 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur モデルの入力と出力の準備 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!