FUNCTION REFERENCE

delete

Delete local files.

Delete local files.

Syntax

delete(filename)

Syntax

delete(pattern1, pattern2, ...)

Supports * and ? in the final path component and at most 64 patterns. A missing file emits a warning. Use rmdir to remove directories. delete(h) with a handle object of a classdef class deletes the object instead (see classdef).

Example

d=tempname(pwd); mkdir(d); f=fullfile(d,'a'); fclose(fopen(f,'w')); delete(f); n=exist(f,'file'); rmdir(d); n   % 0

Differences from MATLAB: Local file deletion only; graphics-object deletion is not supported by this function.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.