我想将文件从一个地方复制到另一个地方,但只复制已创建文件夹的文件,因此源包含文件夹,即' aaa' ' BBB' ' CCC'和目标文件夹包含' bbb' ' CCC'所以我只会复制' bbb'和' ccc'
for i = 3:name_size
MainIMAGE_Path = strcat(file_Paths_main, '\',result(i),'\images');
IMAGE_Path = strcat(file_Paths_images,'\',file_names_images(i).name);
IMAGE_dir = dir(fullfile(IMAGE_Path));
IMAGE_Path = strcat(file_Paths_images,'\',file_names_images(i).name,'\',IMAGE_dir(3).name,'\12*');
copyfile(IMAGE_Path, MainIMAGE_Path{1},'f');
else
end
end
但我不知道如何继续编写代码以使其正常工作,目前它会尝试将文件复制到目标文件夹中不存在的文件夹中
Error using copyfile
No matching files were found.