delete_block
Delete blocks from Simulink system
Syntax
Description
Examples
Delete Block Using Full Path Name
Delete the block Mu from the vdp
system.
open_system('vdp') delete_block('vdp/Mu')
Delete Block Using Block Handle
Delete the block Out2 from the vdp
system
using the block handle.
Open the vdp
system.
open_system('vdp')
Interactively select the block Out1. Get the block’s
handle and assign it to the variable Out1_handle
.
Delete the block using the handle.
Out1_handle = get_param(gcb,'Handle');
delete_block(Out1_handle)
Delete Blocks Using Vector of Handles
Delete three blocks from the vdp
system.
Open the vdp
system. Add three blocks
and assign their handles to variables.
open_system('vdp') Constant_handle = add_block('built-in/Constant','vdp/MyConstant'); Gain_handle = add_block('built-in/Gain','vdp/MyGain'); Outport_handle = add_block('built-in/Outport','vdp/MyOutport');
Delete the blocks you added using a vector of handles.
delete_block([Constant_handle Gain_handle Outport_handle])
Input Arguments
blockArg
— Blocks to delete
full path name | handle | vector of handles | 1-D cell array or string array of handles or block path names
Blocks to delete, specified as the full block path name, a handle, a vector of handles, or a 1-D cell array or string array of handles or block path names.
Example: 'vdp/Mu'
Example: [handle1
handle2]
Example: {'vdp/Mu'
'vdp/Out1' 'vdp/Out2'}
Example: "vdp/Out"+(1:2)
Version History
Introduced before R2006a
See Also
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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é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)