モデル上の全ての信号​線に、信号ロギングの​チェックを自動で付け​ることができますか?

10 visualizaciones (últimos 30 días)
MathWorks Support Team
MathWorks Support Team el 6 de Jun. de 2018
Respondida: MathWorks Support Team el 7 de Jun. de 2018
規模の大きくないモデルを検討しており、モデル上の全ての信号線に信号ロギングのチェックを自動で付けたいと考えています。マウス操作で行うよりも手間のかからない、何か良い方法はあるか、教えて下さい。

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 6 de Jun. de 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

Más respuestas (0)

Categorías

Más información sobre モデルの入力と出力の準備 en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2010a

Community Treasure Hunt

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

Start Hunting!