-
Notifications
You must be signed in to change notification settings - Fork 0
/
mat2excel.m
48 lines (45 loc) · 1.71 KB
/
mat2excel.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
%Pt_Subs = 'D:\yunxia\ML\回归\resultR1toR2';%存放待处理数据的路径
Pt_Subs = 'D:\yunxia\ML\huigui\resultR1toR2';%存放待处理数据的路径
Nm_Vd = [];%存放文件名的结构体
Fd_Subs = dir(Pt_Subs);%提取所有文件
fL = size(Fd_Subs,1);%统计文件个数
for i = 3:fL
Nm_Vd{i-2,1} = Fd_Subs(i).name;%单独提取出文件名属性
end
for i=1:1:5
nm_vd = Nm_Vd{i,1};
%Local = strcat('D:\yunxia\ML\回归\resultR1toR2\',nm_vd);
Local = strcat('D:\yunxia\ML\huigui\resultR1toR2\',nm_vd);
datas = load(Local);
datas = datas.R_matrix;
datas(isnan(datas))=0;
nm_vd = nm_vd(1:end-4);
savename = strcat('D:\yunxia\ML\huigui\resultExcel_R1toR2\',nm_vd,'.xlsx');%存为xls文件
%savename(end-3:end) = [];
%save(savename,'datas');
xlswrite(savename,datas);
end
for i=6:1:10
nm_vd = Nm_Vd{i,1};
%Local = strcat('D:\yunxia\ML\回归\resultR1toR2\',nm_vd);
Local = strcat('D:\yunxia\ML\huigui\resultR1toR2\',nm_vd);
datas = load(Local);
datas = datas.R_max;
nm_vd = nm_vd(1:end-4);
savename = strcat('D:\yunxia\ML\huigui\resultExcel_R1toR2\',nm_vd,'.xlsx');%存为xls文件
%savename(end-3:end) = [];
%save(savename,'datas');
xlswrite(savename,datas);
end
for i=11:1:15
nm_vd = Nm_Vd{i,1};
%Local = strcat('D:\yunxia\ML\回归\resultR1toR2\',nm_vd);
Local = strcat('D:\yunxia\ML\huigui\resultR1toR2\',nm_vd);
datas = load(Local);
datas = datas.wave_selected;
nm_vd = nm_vd(1:end-4);
savename = strcat('D:\yunxia\ML\huigui\resultExcel_R1toR2\',nm_vd,'.xlsx');%存为xls文件
%savename(end-3:end) = [];
%save(savename,'datas');
xlswrite(savename,datas);
end