-
Notifications
You must be signed in to change notification settings - Fork 6
/
testf.m
66 lines (63 loc) · 1.38 KB
/
testf.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
File=load('matlab');
D_Kp={};
D_Kp_NN =[];
for i=1:1471
if File.Data(i,3)== 1
D_Kp(i)={'ZE'};
D_Kp_NN(i,:)=[1,0,0,0,0];
elseif File.Data(i,3)== 2
D_Kp(i)={'S'};
D_Kp_NN(i,:)=[0,1,0,0,0];
elseif File.Data(i,3)== 3
D_Kp(i)={'M'};
D_Kp_NN(i,:)=[0,0,1,0,0];
elseif File.Data(i,3)== 4
D_Kp(i)={'B'};
D_Kp_NN(i,:)=[0,0,0,1,0];
elseif File.Data(i,3)== 5
D_Kp(i)={'VB'};
D_Kp_NN(i,:)=[0,0,0,0,1];
end
end
D_Ki={};
D_Ki_NN =[];
for i=1:1471
if File.Data(i,4)== 1
D_Ki(i)={'ZE'};
D_Ki_NN(i,:)=[1,0,0,0,0];
elseif File.Data(i,4)== 2
D_Ki(i)={'S'};
D_Ki_NN(i,:)=[0,1,0,0,0];
elseif File.Data(i,4)== 3
D_Ki(i)={'M'};
D_Ki_NN(i,:)=[0,0,1,0,0];
elseif File.Data(i,4)== 4
D_Ki(i)={'B'};
D_Ki_NN(i,:)=[0,0,0,1,0];
elseif File.Data(i,4)== 5
D_Ki(i)={'VB'};
D_Ki_NN(i,:)=[0,0,0,0,1];
end
end
D_Kd={};
D_Kd_NN =[];
for i=1:1471
if File.Data(i,5)== 1
D_Kd(i)={'ZE'};
D_Kd_NN(i,:)=[1,0,0,0,0];
elseif File.Data(i,5)== 2
D_Kd(i)={'S'};
D_Kd_NN(i,:)=[0,1,0,0,0];
elseif File.Data(i,5)== 3
D_Kd(i)={'M'};
D_Kd_NN(i,:)=[0,0,1,0,0];
elseif File.Data(i,5)== 4
D_Kd(i)={'B'};
D_Kd_NN(i,:)=[0,0,0,1,0];
elseif File.Data(i,5)== 5
D_Kd(i)={'VB'};
D_Kd_NN(i,:)=[0,0,0,0,1];
end
end
D_Labels= [D_Kp; D_Ki; D_Kd;]
D_NN_Labels=[D_Kp_NN_Labels; D_Ki_NN; D_Kd_NN];