-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSingleSimulationStam.m
More file actions
37 lines (29 loc) · 842 Bytes
/
SingleSimulationStam.m
File metadata and controls
37 lines (29 loc) · 842 Bytes
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
% simulate using artificial matrices
%% init
% clear workspace
clearvars();
% paths
addpath(genpath('./Helper Functions/'));
addpath(genpath('./BCT/'));
%% simulate
[C_t, E_t, L_s] = NMMStam();
C = squeeze(C_t(end,:,:));
%HeatMap(C);
%% stability plot
%con = C_t(1 : size(C_t, 1), 1, 10);
%csvwrite('./R/Results/stability/stam.csv', con);
%% power spectrum
% most injured node
L_n = sum(L_s);
[~, ix] = max(L_n);
steps = 400000;
duration = 50000;
pre = (steps / 2 - duration + 1 : steps / 2);
post = (steps / 2 + 1 : steps / 2 + duration);
Fs = 600;
[preF, preP] = PowerSpectrum(E_t(ix, pre), Fs);
[postF, postP] = PowerSpectrum(E_t(ix, post), Fs);
PS_most_pre = [preF; preP'];
PS_most_post = [postF; postP'];
csvwrite('./R/Results/injury/PS_stam_pre.csv', PS_most_pre);
csvwrite('./R/Results/injury/PS_stam_post.csv', PS_most_post);