delete_line
Delete line from万博1manbetxmodel
Syntax
delete_line(sys,out,in)
delete_line (sys,点)
delete_line(lineHandle)
Description
Examples
Remove Line Using Block Port Names
For the modelvdp
, remove the line connecting the Product block with the Gain block.
load_system('vdp'); delete_line('vdp','Product/1','Mu/1');
Remove Line Using Line Handle
For the modelvdp
, remove a line using the line handle. You can get the line handle using different techniques.
load_system('vdp'); h = get_param('vdp/Mu','LineHandles'); delete_line(h.Outport(1));
Get a line handle when you create the line. Delete the line using that handle.
a = add_line('vdp','Mu/1','Sum/2'); delete_line(a)
Delete a Line Using a Point
You can use a point on the line to delete the whole line.
Find the port coordinates for the block Mu in the modelvdp
.
open_system('vdp'); mu = get_param('vdp/Mu',“ portconnectivity'); mu.Position
ans =1×2190 150
ans =1×2225 150
The line that connects the Mu block to the Sum block starts at the output port, which is at (225,150). You can use any point to the right of that point along the samex-axis to delete the line.
delete_line('vdp',[230,150]);
删除分支线的段
Usedelete_line
with branched lines to remove the segment for any connection.
打开模型vdp
.
open_system('vdp');
Delete the line from x1 to the Out1 block. This command deletes only the segment of the line that connects the branch to the specified block.
delete_line('vdp','x1/1','Out1/1')
Delete the line segment from x2 to the Mux.
delete_line('vdp','x2/1','Mux/2')
Delete the line segment from x2 to the Product block.
delete_line('vdp','x2/1','Product/2')
Input Arguments
sys
—模型或子系统从
character vector
Model or subsystem to delete the line from, specified as a character vector.
Example:'vdp'
,'f14/Controller'
out
—Block output port to delete line from
block/port name or number character vector|port handle
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.
您要从中删除该行的端口处理。
Use“ Porthandles”
withget_param
to get the handles.
Example:'Mu/1'
,“子系统/2”
in
—Block input port to delete line from
block/port name or number character vector|port handle
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.
您要从中删除该行的端口处理。
Use“ Porthandles”
withget_param
to get handles.
Example:'Mu/1'
,“子系统/2”
观点
—您要删除的行上的点
1-by-2 matrix
Point that falls on the line you want to delete, specified as a 1-by-2 matrix.
Example:[150 200]
lineHandle
—要删除的行的手柄
handle
要删除的行的手柄. You can get the line handle by usingget_param
与'LineHandles'
option or by assigning the line to a handle when you create it programmatically.
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.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- AméricaLatina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- 丹麦(English)
- Deutschland(德意志)
- España(Español)
- Finland(English)
- 法国(Français)
- 爱尔兰(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- 挪威(English)
- Österreich(德意志)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)