MATLAB: How to discover all submodels within a simulink model programmatically

get_parammodel hierarchysimulink

I would like to find all models contained in a simulink model programmatically ?
Is there a way to do that for instance with the get_param(model_name, argument) function ?
There is a 'Parent' argument but no 'Children' argument for this function

Best Answer

Using the example model 'f14'. Play with some other options of find_system()
f14;
SubSysBlocks=find_system('f14','BlockType','SubSystem')
Related Question