Delete blocks from Simulink system
Delete Block Using Full Path Name
Delete the block Mu from the
Delete Block Using Block Handle
Delete the block Out2 from the
using the block handle.
Interactively select the block Out1. Get the block’s
handle and assign it to the variable
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. 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])
blockArg — Blocks to delete
full path name | handle | vector of handles | 1-D cell 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 of handles or block path names.
Introduced before R2006a