| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
[refMdls, mdlBlks]
= find_mdlrefs(modelName)
[refMdls, mdlBlks]
= find_mdlrefs(modelName, allLevels)
[refMdls, mdlBlks] = find_mdlrefs(modelName,
'Param1', Val1, ... ,'ParamN', ValN)
[refMdls, mdlBlks] = find_mdlrefs(modelName) finds all Model blocks and referenced models contained by the model hierarchy of which modelName is the top model.
[refMdls, mdlBlks] = find_mdlrefs(modelName, allLevels) is equivalent to the preceding syntax if allLevels is true. If allLevels is false, the function searches only the top level of modelName, ignoring any subordinate hierarchy.
[refMdls, mdlBlks] = find_mdlrefs(modelName, 'Param1', Val1, ... ,'ParamN', ValN) searches the model as specified by the optional name/value pairs 'Param1', Val1, ... , 'ParamN', ValN.
modelName |
The model to be searched for Model blocks and referenced models. |
allLevels |
Boolean specifying whether to search the complete hierarchy (true) or only the top model modelName (false). Default: false. |
'Param1', Val1, ... , 'ParamN', ValN |
One or more name/value pairs that control the function's actions. The possible names and values, and their defaults, are:
|
Note that find_mdlrefs provides two different ways to search all levels of the model modelName. Both techniques give the same results, but only the name/value technique allows you to control inclusion of protected and variant models in refMdls.
mdlBlks |
A list containing the names of all Model blocks in the hierarchy of which modelName is the top model, or in modelName alone, depending on the value of 'AllLevels'. |
refMdls |
A list containing the names of all models referenced by Model block in the hierarchy of which modelName is the top model, or in modelName alone, depending on the value of 'AllLevels'. Optional inputs to find_mdlrefs control inclusion of protected and variant models. The last element of the refMdls is modelName itself. |
Return in MyMdlBlks the names all Model blocks at the top level of MyModel. Return in MyRefMdls the names of all models referenced by Model blocks at the top level, including the active variant of every variant Model block:
[MyRefMdls, MyMdlBlks] = find_mdlrefs(MyModel, 'AllLevels', false, 'Variants', 'ActiveVariants')
![]() | docblock | find_system | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |