delete
- : delete
(file)¶ - : delete
(file1, file2, …)¶ - : delete
(h)¶ Delete files, graphics objects, or handle-class objects.
Each file is a name or a wildcard pattern (‘*’, ‘?’ or ‘[…]’). Only files are removed: folders are never touched, and patterns only match the files they name. Names that match nothing are ignored.
When the argument is a numeric array of graphics handles h, the graphics objects are deleted.
When the argument is a classdef handle object, method dispatch uses the object’s
deletemethod (and the built-inhandle.deletelifecycle) rather than this file function – matching MATLAB R2026a. After a successful handledelete,isvalidis false and property access raisesMATLAB:class:InvalidHandle.