Search code examples
matlabsimulink

Finding SubSystems in a Simulink model using find_system() instruction in Matlab


I am trying to find all the SubSystems present in a Simulink model at a particular Level including the Subsystems from Third Party libraries. However, in the result I get some values instead of names of the SubSystems from Libraries.

Instruction Used:

find_system('Level1/Level2','SearchDepth',1,'LookUnderMasks','on','BlockType','SubSystem')

Result:

'Level1/Subsystem1'
'Level1/SubSystem2'
[1x11 char]
[1x90 char]
[1x34 char]

Solution

  • The find_system method returns handles to simulink blocks. To get the name of the subsystem you have to use the getfullname function to get the names for the handles.