add_line
R2026b(Not recommended) Add line to Simulink model
add_line is not recommended. Use Simulink.connectBlocks instead (since R2024b). For information on updating
your code, see Version History.
Syntax
Description
adds signal lines in the specified model or subsystem that connect the specified
output ports to the specified input ports. Connecting multiple input ports to the
same output port is not supported. The ports must be unconnected and must be in the
same location in the model hierarchy, either at the top level or in the same
component. Each pair of ports that you want to connect must be compatible.handle = add_line(sys,out,in)
This syntax draws the most direct route from port to port, for example, diagonal lines or lines that go through other blocks.
connects blocks, specifying whether to route the lines around other blocks.h = add_line(sys,out,in,autorouting=autoOption)
adds a line drawn by (x,y) coordinate h = add_line(sys,points)points relative to the
upper-left corner of the Simulink® Editor canvas before any canvas resizing. If either end of the line is
within five pixels of a corresponding port, the function connects the line to it.
The line can have multiple segments.