matlab批量导入文件夹下面的数据

我用参考改编后的代码

clc;clear
path='D:\wen_jian\EX work_date\shimo-SiO2\bulid interface\4\inteface\interface\clean\pes\charge-pes\charge-1\';
namelist=dir([path,'*.dat'])
l=length(namelist)
% namelist(1)
A=[]
for i=1:l
   fullname{i}=[path,namelist(i).name];
   A(:,i)=importdata(fullname{i});
   
%     for n=0.0:0.3:3.0
%     datname=[num2str(i)-num2str(n)'.dat'];
%     chr=[filepath datname];
%       x=num2str(i);
%       y=num2str(n)

%     diff=load([filepath '0.0-0.0.dat'])
%     end
 end

参考于这里