-
Notifications
You must be signed in to change notification settings - Fork 0
/
generateArtificialData.m
74 lines (74 loc) · 2.44 KB
/
generateArtificialData.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
function [trajectoryA,trajectoryB] = generateArtificialData(dataType)
lengthTrajectories = 10;
trajectoryA = zeros(lengthTrajectories,2);
trajectoryB = zeros(lengthTrajectories,2);
switch dataType
case 'zickzack'
pointA = [1 0];
pointB = [0 1];
for i = 1:lengthTrajectories
trajectoryA(i,:) = pointA;
trajectoryB(i,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
trajectoryB(10,:) = trajectoryB(9,:);
trajectoryB(9,:) = trajectoryB(8,:);
trajectoryB(8,:) = trajectoryB(7,:);
trajectoryB(7,:) = trajectoryB(6,:) + [-1 0];
case 'crossing'
pointA = [1 0];
pointB = [0 1];
for i = 1:lengthTrajectories
trajectoryA(i,:) = pointA;
trajectoryB(i,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
for i = 7:10
trajectoryB(i,:) = trajectoryA(i,:) + [3 -3];
end
case 'separating'
pointA = [1 0];
pointB = [0 1];
for i = 1:lengthTrajectories
trajectoryA(i,:) = pointA;
trajectoryB(i,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
trajectoryA(6,:) = trajectoryA(5,:) + [1 0];
trajectoryB(5,:) = trajectoryB(4,:) + [-1 0];
pointA = trajectoryA(6,:) + [2 0];
pointB = trajectoryB(5,:) + [-2 0];
for i = 7:10
trajectoryA(i,:) = pointA;
trajectoryB(i-1,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
case 'smalldistance'
pointA = [1 0];
pointB = [0 1];
for i = 1:lengthTrajectories
trajectoryA(i,:) = pointA;
trajectoryB(i,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
commonPoint = trajectoryB(5,:);
trajectoryB(5,:) = commonPoint + [-0.1 0];
trajectoryA(5,:) = commonPoint + [+0.1 0];
trajectoryA(6,:) = commonPoint + [3 0];
trajectoryB(6,:) = commonPoint + [-10 5];
pointA = trajectoryA(6,:);
pointB = trajectoryB(6,:);
for i = 6:10
trajectoryA(i,:) = pointA;
trajectoryB(i,:) = pointB;
pointA = pointA + [1 1];
pointB = pointB + [1 1];
end
otherwise
error('Cannot handle this choice');
end