MATLAB: Overwriting the folder in matlab

folder overwriting

I've created the folder to write images on it by the code
outputFolder = fullfile(cd, 'folder_name');
if ~exist(outputFolder, 'dir')
mkdir(outputFolder);
and I'm in need to overwrite the same folder for writing another set of images. Is there any way to delete all the existing images in the folder for writing new images???

Best Answer

delete('yourfolder/*.*')