delete_line
Delete line from Simulink model
Description
Examples
Open the example. Then, open the vdp
model.
open_system('vdp')
Remove the line connecting the Product block to the masked Subsystem block named Mu
.
delete_line('vdp','Product/1','Mu/1');
Open the example. Then, open the vdp
model.
open_system('vdp')
Get the line handles for the signal lines attached to the masked Subsystem block named Mu
.
h1 = get_param('vdp/Mu','LineHandles');
Delete the line attached to the output port of the masked Subsystem block named Mu
.
delete_line(h1.Outport(1));
You can also get a line handle when you create a line.
Get the line handle while creating a line between the masked Subsystem block named Mu
and the Sum block.
h2 = add_line('vdp','Mu/1','Sum/2');
Delete the line.
delete_line(h2)
Open the example. Then, open the vdp
model.
open_system('vdp')
Get the port coordinates for the masked Subsystem block named Mu
.
mu = get_param('vdp/Mu','PortConnectivity'); mu.Position
ans = 1×2
210 185
ans = 1×2
250 185
The coordinates of the input port are
(210,185)
.The coordinates of the output port are
(250,185)
.
The line that connects the masked Subsystem block named Mu
to the Sum block starts at the output port. To delete the line, you can use any point that is located to the right of the output port and has the same y-coordinate as the output port. For example, you can use the point with the coordinates (250,185)
.
delete_line('vdp',[250,185]);
Open the example. Then, open the vdp
model.
open_system('vdp')
Delete the signal line segment that connects the Integrator block named x1
to the Scope block.
delete_line('vdp','x1/1','Scope/1')
Delete the signal line segment that connects the Integrator block named x2
to the Integrator block named x1
.
delete_line('vdp','x2/1','x1/1')
Delete the line segment that connects the Integrator block named x2
to the Product block.
delete_line('vdp','x2/1','Product/2')
Input Arguments
Model or subsystem to delete the line from, specified as a character vector.
Example: 'vdp'
,
'f14/Controller'
Block output port to delete line from, specified as either:
The block name, a slash, and the port name or number. Most block ports are numbered from top to bottom or from left to right. For a state port, use the port name State instead of a port number.
The port handle that you want to delete the line from.
Use 'PortHandles'
with get_param
to get the handles.
Example: 'Mu/1'
,
'Subsystem/2'
Block input port to delete line from, specified as either:
The block name, a slash, and the port name or number. The port name on:
An enabled subsystem is Enable.
A triggered subsystem is Trigger.
If Action and Switch Case Action subsystems is Action.
The port handle that you want to delete the line from.
Use 'PortHandles'
with get_param
to get handles.
Example: 'Mu/1'
, 'Subsystem/2'
Point that falls on the line you want to delete, specified as a 1-by-2 matrix.
Example: [150 200]
Handle of the line you want to delete. You can get the line handle by
using get_param
with the
'LineHandles'
option or by assigning the line to a
handle when you create it programmatically.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)