1.文件数据读取
file=dir('*.xls');
for i =1:length(file)
disp(file(i).name)
end
2. 总成绩分析
for i=1:length(file)
[~,data,~]=xlsread(file(i).name);
tol_lin=length(data)
data=xlsread(file(i).name,'cj_kccj',['S7:S',num2str(tol_lin-5)])
total_result=[total_result;data];
end
3.卷面成绩分析
3.1 除22、52之外的成绩
由于我的成绩输入跟大家的不一致,因此,首先计算除22和52两个班级之外的成绩;
juan_result=[]
for i=[1,3,4,6,7,8,9]
[~,data,~]=xlsread(file(i).name);
tol_lin=length(data)
[~,data,~]=xlsread(file(i).name,'cj_kccj',['M7:M',num2str(tol_lin-5)])
juan_result=[juan_result;str2num(cell2mat(data))];
end
3.2 加上22和52的成绩
for i=[2,5]
[~,data,~]=xlsread(file(i).name);
tol_lin=length(data)
[~,data,~]=xlsread(file(i).name,'cj_kccj',['R7:R',num2str(tol_lin-5)])
juan_result=[juan_result;str2num(cell2mat(data))];
end
4. 分布分析
4.1计算除22和52的成绩
dis_result=[]
for i=[1,3,5,6,7,8,9]
[~,data,~]=xlsread(file(i).name);
tol_lin=length(data)
[~,data,~]=xlsread(file(i).name,'cj_kccj',['M7:M',num2str(tol_lin-5)])
data=str2num(cell2mat(data));
dis_result=cat(1,dis_result,distri(data));
end
4.2计算22和52的成绩分布
for i=[2,4]
[~,data,~]=xlsread(file(i).name);
tol_lin=length(data)
[~,data,~]=xlsread(file(i).name,'cj_kccj',['R7:R',num2str(tol_lin-5)])
data=str2num(cell2mat(data));
dis_result=cat(1,dis_result,distri(data));
end
4.3 进行数据汇总
tt=0;
for i=[1,3,5,6,7,8,9]
tt=tt+1;
name=file(i).name;
xlswrite('result.xlsx',name(1:6),'Sheet1',['A',num2str(tt)]);
end
xlswrite('result.xlsx',name(1:6),'Sheet1',['A',num2str(tt)]
网友评论