I want to create a loop to delete file within specific file size and I have these problems.
selpath = uigetdir(files)
for ii = 1:length(files)
if files(ii).bytes<500000 % 500kb
delete(fullfile(files(ii).folder, files(ii).name))
end
end
and I always got this message
>> cobayginibro
selpath =
'D:\Proyekan Tes'
Struct contents reference from a non-struct array object.
Error in cobayginibro (line 3)
if files(ii).bytes<500000 % 500kb
Any idea how to solve this? Also I want to fprint how many files i've deleted Thanks before
filesand how is it set?