How can I get the input names of the first level only in my simulink model?

With this code I can get all the inputs off my simulink model
rootHdl = get_param(bdroot, 'Handle');
sysIns = find_system(rootHdl, 'BlockType', 'Inport');
inportNames = get_param(sysIns, 'Name');
%I would like to have only the firsrt level?
Thanks in advance

 採用された回答

Bharath Venkataraman
Bharath Venkataraman 2021 年 12 月 8 日

0 投票

You can use the SearchDepth parameter to specify the depth of the search.
sysIns = find_system(bdroot,'SearchDepth',1, 'BlockType', 'Inport')
finds the input ports at the first level.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Verification, Validation, and Test についてさらに検索

製品

リリース

R2016b

タグ

質問済み:

Ali
2021 年 12 月 8 日

コメント済み:

Ali
2021 年 12 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by