bl = Simulink.findBlocksOfType(sys,type,Param1=Value1,...,ParamN=ValueN,options)
finds blocks whose parameters have the specified values and that match the criteria
specified by a FindOptions object.
Get the handles of all Transfer Fcn blocks in the
model.
h = Simulink.findBlocksOfType("myModel","TransferFcn");
Suppose you have a loaded model named
myModel. The model contains a Subsystem
block named mySubsystem.
Get the handles of all Transfer Fcn blocks in the
subsystem.
h = Simulink.findBlocksOfType("myModel/mySubsystem","TransferFcn");
Suppose you have a loaded model named
myModel. The model contains masked subsystems. Get the
handles of all Transfer Fcn blocks in the model, excluding blocks
in the masked subsystems.
Create a FindOptions object that specifies you want to
exclude the content of masked subsystems in the search.
f = Simulink.FindOptions(SearchUnderMasks="none");
Get the block handles.
h = Simulink.findBlocksOfType("myModel","TransferFcn",f);
Suppose you have a model named
myModel.
Get the handles of all Gain blocks in the model whose
Gain value is 5.
h = Simulink.findBlocksOfType("myModel","Gain",Gain="5");
Model or subsystem to search for blocks. Specify a model using a name, and
a subsystem using the block path of the corresponding
Subsystem block. Format the name or path as a string or
character vector.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.