| Using Simulink | ![]() |
Add a block to a Simulink system.
Syntax
add_block('src', 'dest')
add_block('src', 'dest', 'parameter1', value1, ...)
Description
add_block('src', 'dest') copies the block with the full pathname 'src' to a new block with the full path name 'dest'. The block parameters of the new block are identical to those of the original. The name 'built-in' can be used as a source system name for all Simulink built-in blocks (blocks available in Simulink block libraries that are not masked blocks).
add_block('src', 'dest_obj', 'parameter1', value1, ...) creates a copy as above, in which the named parameters have the specified values. Any additional arguments must occur in parameter-value pairs.
Examples
This command copies the Scope block from the Sinks subsystem of the simulink system to a block named Scope1 in the timing subsystem of the engine system.
add_block('simulink/Sinks/Scope', 'engine/timing/Scope1')
This command creates a new subsystem named controller in the F14 system.
add_block('built-in/SubSystem', 'F14/controller')
This command copies the built-in Gain block to a block named Volume in the mymodel system and assigns the Gain parameter a value of 4.
add_block('built-in/Gain', 'mymodel/Volume', 'Gain', '4')
See Also
delete_block, set_param
| How to Specify a Path for a Simulink Object | add_line | ![]() |