Simulinkモデルの入出力ポートのデータタイプをコマンドで取得するにはどうすればよいですか?
19 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Simulinkモデルの入出力ポートのデータタイプをコマンドで取得する方法を教えてください。
Respuesta aceptada
MathWorks Support Team
el 1 de Abr. de 2011
モデルのコンパイルを行った後、'CompiledPortDataType'プロパティを取得することで、データタイプを取得することができます。
% モデルオープン
open_system('vdp')
% モデルのコンパイル
vdp([],[],[],'compile');
% 全ブロックの取得
BlockName = find_system('vdp','Regexp','on','BlockType','.');
% ポートハンドルの取得
h = get_param(BlockName,'Porthandles');
for n=1:length(h)
disp('ブロック名:')
disp(BlockName{n})
% 入力ポートのデータタイプを取得
disp('入力ポートのデータタイプ:')
disp(get_param(h{n}.Inport,'CompiledPortDataType'))
% 出力ポートのデータタイプを取得
disp('出力ポートのデータタイプ:')
disp(get_param(h{n}.Outport,'CompiledPortDataType'))
disp(char(10))
end
% コンパイルの終了
vdp([],[],[],'term')
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre プログラムによるモデル編集 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!