程序是为了批量读取一个文件夹下的多个子文件夹里的多个图片可是运行时出现了下面的错误,新人菜鸟,求大神指点
附上程序源码:
function T = CreateDatabase(TrainDatabasePath)
a = dir('D:\TrainDatabasePath');
TrainFiles = a(3:end);
Train_Number = 0;
for i = 1:size(TrainFiles,1)
if not(strcmp(TrainFiles(i).name,'.')|strcmp(TrainFiles(i).name,'..')|strcmp(TrainFiles(i).name,'Thumbs.db'))
Train_Number = Train_Number + 1; % Number of all images in the training database
end
end
T = [];
for i = 1 : Train_Number
str = int2str(i);%把整形转换成字符串的形式
% str = strcat('\','s',str);
%str = strcat('D:\TrainDatabasePath\s',str,'\');%strcat连接字符串
for j=1:5
img = imread(strcat('D:\TrainDataba