选择.tif文件从一个文件夹并将其复制到另一个文件夹

14日视图(30天)
这就跟你问声好!
我有这些34天文件夹,每个文件夹包含3图像(.tif)文件。我想选择这些.tif文件和 复制 他们另一个文件夹命名为“All_tif_images”。
我写下了这段代码,但它不工作。谁能请告诉我代码有什么问题吗?任何反馈将感谢!
清晰的所有;关闭所有;clc;
家=' /用户/ aahmed78 /博士/数据/ SWOT /博福特环流- CalVal / May2015 ';
一天= [34];
foldername =“All_tif_images”;
zz = 1:尺寸(天,2)
cd (strcat(家,“每天”num2str(天(zz))))
file_list = dir (‘* .tif‘);
filenumber =长度(file_list);
我= 1:filenumber
文件名= file_list . name(我);
cd (“. .”);
拷贝文件(文件名,cd (strcat(家,' / All_tif_images ')));
结束
结束

接受的答案

沃斯
沃斯 2022年4月10日
清晰的所有;关闭所有;clc;
家=' /用户/ aahmed78 /博士/数据/ SWOT May2015”;
foldername =“All_tif_images”;
foldername = fullfile(家里,foldername);
file_list = dir (fullfile(家,“天*”,‘* .tif‘));
2 = 1:元素个数(file_list)
文件名= fullfile (file_list (ii) .folder file_list (ii) . name);
拷贝文件(文件名,foldername);
结束

更多的答案(0)

社区寻宝

找到宝藏在MATLAB中央,发现社区如何帮助你!

开始狩猎!