-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_structured_data2.m
95 lines (85 loc) · 2.11 KB
/
block_structured_data2.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
% figure(1);
N = 80;
T = 23;
Adj = zeros(N, N, T);
C = 4;
bd = [0 12 43 54 80];
for t = 1:4
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc ~= 3
Adj(dex, dex, t) = 1;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.025;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
bd = [0 12 43 54 80];
for t = 5:8
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc ~= 3
Adj(dex, dex, t) = 1;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.025;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
%subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
bd = [0 8 16 36 60 80];C = 5;
for t = 9:12
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
Adj(dex, dex, t) = 1;
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
C = 4;
bd = [0 12 43 54 80];
for t = 13:16
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc ~= 3
Adj(dex, dex, t) = 1;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.025;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
%subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
bd = [0 8 16 36 60 80];C = 5;
for t = 17:19
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
Adj(dex, dex, t) = 1;
% Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
% subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
C = 4;
bd = [0 12 43 54 80];
for t = 20:23
for cc = 1:C
dex = bd(cc)+1:bd(cc+1);
if cc ~= 3
Adj(dex, dex, t) = 1;
else
Adj(dex, dex, t) = rand(numel(dex)) < 0.025;
end
end
Adj(:, :, t) = Adj(:, :, t)+double(rand(N) < 0.025);
Adj(:, :, t) = Adj(:, :, t) - diag(diag(Adj(:, :, t)));
%subplot(T, 4, (t-1)* 4 + 1);imagesc(Adj(:,:,t));
end
Adj = double(Adj > 0);