matlab遍历文件夹下的所有文件
function [names,class_num] = GetFiles(SamplePath1 )
SamplePath1 = 'C:\Users\Administrator\Desktop\CDG\';
files = dir(SamplePath1);
size0 = size(files);
length = size0(1);
for i=3:length;
fileName = strcat(SamplePath1,files(i,1).name);
names(:,:,i-2) = fileName;
end
class_num = size(names);
end