| MATLAB Function Reference | ![]() |
As an alternative to the delete function, you can delete files using the Current Directory Browser, as described in the Desktop Tools and Development Environment documentation.
delete filename
delete(h)
delete('filename')
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.
Note The MATLAB® software does not ask for confirmation when you enter the delete command. To avoid accidentally losing files or graphics objects that you need, make sure that you have accurately specified the items you want deleted. |
The action that the delete function takes on deleted files depends upon the setting of the MATLAB recycle state. If you set the recycle state to on, MATLAB moves deleted files to your recycle bin or temporary directory. With the recycle state set to off (the default), deleted files are permanently removed from the system.
To set the recycle state for all MATLAB sessions, use the Preferences dialog box. Open the Preferences dialog and select General. To enable or disable recycling, click Move files to the recycle bin or Delete files permanently. See General Preferences for MATLAB® Applicationin the Desktop Tools and Development Environment documentation for more information.
The delete function deletes files and handles to graphics objects only. Use the rmdir function to delete directories.
To delete all files with a .mat extension in the ../mytests/ directory, type
delete('../mytests/*.mat')To delete a directory, use rmdir rather than delete:
rmdir mydirectory
recycle, dir, edit, fileparts, mkdir, rmdir, type
![]() | delaunayn | delete (COM) | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |