-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_structured_data5.m
111 lines (101 loc) · 2.54 KB
/
block_structured_data5.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
N = 50;
T = 50;
Adj = zeros(N, N, T);
%% 1-10
C = 5;
bd = [0 12 20 32 40 50];
for t = 1:10
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc == 2 || cc==4
Adj(dex, dex, t) = rand(numel(dex)) < 0.02;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
%% 11-20
% C = 5;bd = [0 15 21 31 38 50];
C = 6;bd = [0 15 24 34 41 48 50];
for t = 11:20
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc == 2 || cc==4 || cc==6
Adj(dex, dex, t) = rand(numel(dex)) < 0.02;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
%% 21- 30
C = 5;
bd = [0 10 20 28 36 50];
for t = 21:30
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
%% 31-40
C = 5;
bd = [0 12 20 32 40 50];
for t = 31:40
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc == 2 || cc==4
Adj(dex, dex, t) = rand(numel(dex)) < 0.02;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
%% 41- 50
% C = 5;
% bd = [0 10 20 28 36 50];
% for t = 41:50
% for cc = 1:C
% dex = bd(cc)+1:bd(cc+1);
% if cc == 2 % || cc==4
% Adj(dex, dex, t) = rand(numel(dex)) < 0.02;
% else
% Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
% end
% end
% Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
% Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% % subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
% end
C = 3;
bd = [0 16 34 50];
for t = 41:50
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
% if cc == 2 % || cc==4
% Adj(dex, dex, t) = rand(numel(dex)) < 0.02;
% else
Adj(dex, dex, t) = rand(numel(dex)) < 0.55;
% end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.03);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
remove_id = [3 5 7 8 9 11 13 15 18 20 21 23 24];
for id = 1:numel(remove_id)
Adj(remove_id(id), :, t) = 0;
Adj(:, remove_id(id), t) = 0;
end
end
%
Adj = double(Adj > 0);