-
Notifications
You must be signed in to change notification settings - Fork 1
/
InjuryComparison.m
59 lines (46 loc) · 1.36 KB
/
InjuryComparison.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
% simulate using artificial matrices
%% init
% clear workspace
clearvars();
% paths
addpath(genpath('./Helper Functions/'));
addpath(genpath('./BCT/'));
% load settings
settings = Settings();
% focal or diffuse injury
settings.focal = false;
% distance matrix
Dist = DistMatrix(settings.N);
%% difuse vs focal injury comparison
iterations = 10;
% healthy metrics
M = zeros(iterations, 5);
M_f = zeros(iterations, 5);
M_d = zeros(iterations, 5);
for i = 1:iterations
% report
disp(['Iteration: ', num2str(i), '/', num2str(iterations)])
% simulate
[C_t, E_t, L_s] = NMM(settings, Dist, true);
C = squeeze(C_t(settings.steps, :, :));
M(i,:) = Metrics(C);
% focal
[C_f, L_f] = InjuryInit(C, true);
M_f(i,:) = Metrics(C_f);
% diffuse
[C_d, L_d] = InjuryInit(C, false);
M_d(i,:) = Metrics(C_d);
% in first iteration store matrices
if (i == 1)
% save
csvwrite('./R/Results/matrices/C_h.csv', C);
csvwrite('./R/Results/matrices/C_f.csv', C_f);
csvwrite('./R/Results/matrices/L_f.csv', L_f);
csvwrite('./R/Results/matrices/C_d.csv', C_d);
csvwrite('./R/Results/matrices/L_d.csv', L_d);
end
end
% save
%csvwrite('./R/Results/injury/metrics_connectome.csv', M);
%csvwrite('./R/Results/injury/metrics_focal.csv', M_f);
%csvwrite('./R/Results/injury/metrics_diffuse.csv', M_d);