Main Content

delete

Class: handle

Delete handle object

Syntax

delete(H)

Description

delete(H) deletes the handle object. After calling 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.

Input Arguments

expand all

Handle object to delete, specified as the handle variable.

Attributes

Accesspublic

To learn about attributes of methods, see Method Attributes.

Extended Capabilities

Thread-Based Environment
Run code in the background using MATLAB® backgroundPool or accelerate code with Parallel Computing Toolbox™ ThreadPool.