Main Content

delete

Class:handle

Delete handle object

Syntax

delete(H)

Description

delete(H)deletes the handle object. After callingdelete,His an invalid object (the object is destroyed). IfHis an array of handle objects, then MATLAB®calls thedeletemethod on each object in the array.

Subclasses of thehandleclass can implement a method nameddeleteto perform cleanup tasks just before destroying objects of the class. MATLAB calls thedeletemethod of anyhandleobject automatically when the object is destroyed. The subclassdeletemethod must meet certain criteria to be called by MATLAB during object destruction. For information on implementing adelete的一个子类的方法handle, seeHandle Class Destructor.

Input Arguments

expand all

Handle object to delete, specified as the handle variable.

Attributes

Access public

To learn about attributes of methods, see方法属性.