我的文件命名是这样的
01.xls
02.xls
....
099.xls
100.xls
101.xls
...
共255个文件夹,因为我的excel文件中sheet1,sheet2,sheet3是三个重复,所以我最后求取的是平均值
for i = 1:255
if i<100
filename = strcat('0',num2str(i),'.xls');
else
filename = strcat(num2str(i),'.xls');
end
a1(:,1)=xlsread(filename,'sheet1','D22:D30');
a1(:,2)=xlsread(filename,'sheet2','D22:D30');
a1(:,3)=xlsread(filename,'sheet3','D22:D30');
a(i,91:99)=mean(a1,2);
end
保存一下