Main Content
delete
Class: handle
Delete handle object
Syntax
delete(H)
Description
delete(
deletes the handle object. After calling H
)delete
, H
is an invalid object (the object is destroyed). If H
is an array of handle objects, then MATLAB® calls the delete
method on each object in the array.
Subclasses of the handle
class can implement a method named delete
to perform cleanup tasks just before destroying objects of the class. MATLAB calls the delete
method of any handle
object automatically when the object is destroyed. The subclass delete
method must meet certain criteria to be called by MATLAB during object destruction. For information on implementing a delete
method for a subclass of handle
, see Handle Class Destructor.