-
Notifications
You must be signed in to change notification settings - Fork 0
/
nodeActivity.m
54 lines (42 loc) · 1.35 KB
/
nodeActivity.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
function nodeActivity(w_norm, w_path, r_norm, r_path)
global N
k = 1:length(r_norm);
[B,XY] = bucky;
Normal_activity = 100*sum(r_norm)/N;
Path_activity = 100*sum(r_path)/N;
k = 1:length(r_norm);
temp = [];
for i = 1:length(r_norm)
for j = 1:length(r_norm)
if r_norm(i) == 1 & r_norm(j) ==1;
temp = [temp; i j 1];
else
temp = [temp; i j 0];
end
end
end
D = sparse(temp(:,1),temp(:,2),temp(:,3));
figure;
subplot(121);
gplot(w_norm,XY(k,:),'-*'); hold on;
gplot(D,XY(k,:),'r')
set(gca,'XTick', []); set(gca,'YTick', []);
title(['Normal Connectivity, ' num2str(Normal_activity) '% Active']);
legend('All Possible Connections', 'Active Connections', 'Orientation', 'horizontal', 'Location', 'south');
temp = [];
for i = 1:length(r_path)
for j = 1:length(r_path)
if r_path(i) == 1 & r_path(j) ==1;
temp = [temp; i j 1];
else
temp = [temp; i j 0];
end
end
end
C = sparse(temp(:,1),temp(:,2),temp(:,3));
subplot(122);
gplot(w_path,XY(k,:),'-*'); hold on;
gplot(C,XY(k,:),'r')
set(gca,'XTick', []); set(gca,'YTick', []);
title(['Pathological Connectivity, ' num2str(Path_activity) '% Active']);
legend('All Possible Connections', 'Active Connections', 'Orientation', 'horizontal', 'Location', 'south');