-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate_test_data.m
83 lines (66 loc) · 1.64 KB
/
generate_test_data.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
%% Set Training Data in terms of x,y cordinates.
data = [];
% % ai data
data_ai = dlmread('ai.ldf');
training_rows = uint16(0.7 * size(data_ai,1));
data_ai = data_ai(training_rows+1:size(data_ai,1),2:size(data_ai,2));
% % la data
data_la = dlmread('lA.ldf');
training_rows = uint16(0.7 * size(data_la,1));
data_la = data_la(training_rows+1:size(data_la,1),2:size(data_la,2));
% % ta data
data_ta = dlmread('tA.ldf');
training_rows = uint16(0.7 * size(data_ta,1));
data_ta = data_ta(training_rows+1:size(data_ta,1),2:size(data_ta,2));
%% Concatenate all the data
for i=1:size(data_ai,1)
j=1;
k=1;
temp = [];
run = true;
while (j<=size(data_ai,2) && run == true)
if(data_ai(i,j) == 0)
run = false;
else
temp(k,1) = data_ai(i,j);
temp(k,2) = data_ai(i,j+1);
end
k = k+1;
j = j+2;
end
data = [data;temp];
end
for i=1:size(data_la,1)
j=1;
k=1;
temp = [];
run = true;
while (j<=size(data_la,2) && run == true)
if(data_la(i,j) == 0)
run = false;
else
temp(k,1) = data_la(i,j);
temp(k,2) = data_la(i,j+1);
end
k = k+1;
j = j+2;
end
data = [data;temp];
end
for i=1:size(data_ta,1)
j=1;
k=1;
temp = [];
run = true;
while (j<=size(data_ta,2) && run == true)
if(data_ta(i,j) == 0)
run = false;
else
temp(k,1) = data_ta(i,j);
temp(k,2) = data_ta(i,j+1);
end
k = k+1;
j = j+2;
end
data = [data;temp];
end