'get' do not provide the name of outports for some subsystems

1 回表示 (過去 30 日間)
Ewela
Ewela 2021 年 10 月 20 日
コメント済み: Paul 2021 年 10 月 25 日
I came across a problem with get function. For some subsystems these lines below do not provide the name of port of subsystem, even there is one, and there is name.
connected_inports_handle = get_param(block_of_interest,'PortHandles');
lineHnd = get(connected_inports_handle.Inport(i),'line');
SubName = get(lineHnd,'SourcePort');% get source port number of sub
SubHnd = get(lineHnd,'SrcBlockHandle');% get source block i.e Subsystem
OPName = get(find_system(SubHnd,'BlockType','Outport'),'Name');% get all outport name of subsystem
For some subsystems OPNAME = [], for some it is correct, e.g. [out1, out2] etc.
  7 件のコメント
Ewela
Ewela 2021 年 10 月 25 日
It works on the dummy model, but do not want to work on orginal file. I try to investigate the issue to be precise in issue definition.
Paul
Paul 2021 年 10 月 25 日
Don't know if it makes a difference, but shouldn't those calls to get() really be calls to get_param()? Is that a documented use of get() ?

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

回答 (0 件)

カテゴリ

Help Center および File ExchangeProgrammatic Model Editing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by