| MATLAB Function Reference | ![]() |
Delete files or graphics objects
Graphical Interface
As an alternative to the delete function, you can delete files using the Current Directory browser. To open it, select Current Directory from the View menu in the MATLAB desktop.
Syntax
delete filename
delete(h)
delete('filename')
Description
delete filename
deletes the named file from the disk. The filename may include an absolute pathname or a pathname relative to the current directory. The filename may also include wildcards, (*).
delete(h)
deletes the graphics object with handle h. The function deletes the object without requesting verification even if the object is a window.
delete('filename')
is the function form of delete. Use this form when the filename is stored in a string.
Examples
To delete all files with a .mat extension in the ../mytests/ directory,
delete('../mytests/*.mat')
To delete a directory, use !rmdir rather than delete.
!rmdir mydirectory
See Also
| delaunayn | delete (serial) | ![]() |