clear
clc
close all
% 指定文件夹路径
folderPath = 'C:\Users\Administrator\Desktop\test';
cd(folderPath)
% 获取文件夹中所有文件的信息
files = dir(fullfile(folderPath, '*.png')); % 更改扩展名以匹配你的文件类型
% 删除每个照片文件
for i = 1:length(files)
filePath = fullfile(folderPath, files(i).name);
delete(filePath);
end