2
votes

In a simulink subsystem, I would like to replace all From-blocks by corresponding In-/Outports and a From-block in the parent system. Is there a MATLAB function which returns the parent system of a subsystem, or a convenient way to achieve this without tweaking path strings?

1

1 Answers

6
votes

For any block (including a subsystem), you can ask for the value of the parameter Parent,

>> get_param('model/ParentSystem/ChildSystem', 'Parent');

ans =

'model/ParentSystem'

>>