Looking for a function to get Number and Names of Input/Output from a model

2 次查看(过去 30 天)
Hello,
I'm would get with a matlab function all the input and the output names of a specified model. I'm pretty sure I've seen a function like that but I didn't find it. I know I can do my job with MDLInfo but it is not very optimized for my application.
Hope someone could have my answer.
Thanks !

采纳的回答

Fangjun Jiang
Fangjun Jiang 2022-5-24
If the Inport/Outport block names are good enough,
blks=find_system('ModelName','FindAll','On','SearchDepth',1,'BlockType','Inport')
get(blks,'Name')
length(blks)
More elaborated codes are needed if you want the signal line names (but some of them could be empty)

更多回答(0 个)

类别

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

产品


版本

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by