I have a protected model (.slxp) in simulink with 150 inputs and 50 outputs, and a I need to automatize the process of connecting them to other blocks input/outputs. Im trying to get a 2 columns matrix with the string name of the port and the number associated. And later, use the add_line command in a script to connect to others blocks.
I have tried this with a compilated simple model with less inputs/outputs and i get a matrix cell like the following:
And the code I used is:
block = get_param('Compiled/Block','Handle');
block_handles = find_system(block,'LookUnderMasks', 'on', 'FollowLinks', 'on', 'SearchDepth', 1, 'BlockType', 'Inport');
block_InPortInfo = [get_param(block_handles, 'Name') get_param(block_handles, 'port') ];
But if I use this code with a protected simulink block the variable
is empty [ ].
Is there any way I can retrieve this information of the ports of a protected block in simulink?