matlab遍历文件夹下的所有文件

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

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qestion_yz_10086/article/details/108252712
今日推荐