-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreproduce_fig_3.m
More file actions
82 lines (62 loc) · 1.63 KB
/
reproduce_fig_3.m
File metadata and controls
82 lines (62 loc) · 1.63 KB
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
% Reproduce figure 3 in the manuscript
%% D1
clear synthdata
load('./data/synthdb/data_synthdb_c_10_alpha_4.mat')
y1 = synthdata.y;
time1 = synthdata.time;
delta1 = synthdata.delta;
in1 = synthdata.in;
xtrue1 = synthdata.x;
%% D2
clear synthdata
load('./data/synthdb/data_synthdb_c_1_alpha_4.mat')
y2 = synthdata.y;
time2 = synthdata.time;
delta2 = synthdata.delta;
in2 = synthdata.in;
xtrue2 = synthdata.x;
%% D3
clear synthdata
load('./data/synthdb/data_synthdb_c_1_alpha_1.mat')
y3 = synthdata.y;
time3 = synthdata.time;
delta3 = synthdata.delta;
in3 = synthdata.in;
xtrue3 = synthdata.x;
%%
figure(1), clf
for jj = 1:3
switch jj
case 1,
y = y1; time = time1; in = in1; xtrue = xtrue1;
case 2,
y = y2; time = time2; in = in2; xtrue = xtrue2;
case 3,
y = y3; time = time3; in = in3; xtrue = xtrue3;
end
subplot(1,3,jj)
idx = find(in==1);
u = 0.5; base = 5;
lower = base*ones(size(idx));
upper = base +u*ones(size(idx));
plot([time(idx);time(idx)],[lower;upper],'color','k')
hold on
plot(time,xtrue,'color',blue)
hold on
for ii = 1:size(y,1)
idx = find(y(ii,:)==1);
u = 0.5;
lower = -1-(ii)*u*ones(size(idx));
upper = -1-(ii+0.8)*u*ones(size(idx));
plot([time(idx);time(idx)],[lower;upper],'color',green)
hold on
end
ylim([-7,6])
xlabel('Time (s)')
if jj == 1, ylabel('Data'); end
hold off
end
set(gcf,'units','centimeters');
pos = get(gcf,'position');
set(gcf,'position',[pos(1:2),17,10]);
matlabfrag('./fig/fig-3')