replace_block
Replace blocks in Simulink model
Syntax
Description
replaces
the blocks replBlks
= replace_block(sys
,current
,new
)current
in the model sys
with
blocks of type new
. You can use a block from
a Simulink® library or from another model as the replacement block.
Load the model sys
before using this function.
The function prompts you to select the blocks you want to replace
from a list of blocks that match the current
argument.
Tip
Save the model before using this command.
replaces
the blocks that match the block parameters specified by the replBlks
= replace_block(sys
,Name,Value
,new
)Name,Value
pair
arguments. You can also use find_system
Name,Value
pairs
to qualify the search for blocks to replace.
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
With the replace_block
function, you can
use block parameter and value pairs. For a list of all the block parameters,
see Common Block Properties and Block-Specific Parameters.
To specify additional information about the search for blocks
to replace, you use find_system
Name,Value
pairs
before the block parameters. For example, you can use 'CaseSensitive','off'
to
make the search for blocks case insensitive or 'FollowLinks','on'
to
follow links into library links. See find_system
for
that list of Name,Value
pairs.