add_line
Add line to Simulink model
Syntax
Description
adds a line in the model or subsystem h
= add_line(sys
,out
,in
)sys
that connects one
block's output port out
to another block's input port
in
. This syntax draws the most direct route from port to
port, for example, diagonal lines or lines that go through other blocks.
You can connect ports when:
The input port does not already have a connection.
The ports are compatible for connecting.
The ports are either both at the top level of the model hierarchy or both in the same model component, for example, in the same subsystem. To connect blocks in different components, use the
Simulink.connectBlocks
function.
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.
Examples
Input Arguments
Output Arguments
Version History
Introduced before R2006a