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

32 次查看(过去 30 天)
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
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 个)

类别

Help CenterFile Exchange 中查找有关 Modeling 的更多信息

标签

产品


版本

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by