forked from fpellegrini/FCsim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fp_read_computation_times.m
81 lines (65 loc) · 3.3 KB
/
fp_read_computation_times.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
function fp_read_computation_times
% Copyright (c) 2022 Franziska Pellegrini and Stefan Haufe
fp_addpath
DIRIN = '/home/bbci/data/haufe/Franziska/data/mim_sim5/';
DIROUT_ctimes = '/home/bbci/data/haufe/Franziska/data/mim_sim5/computation_times/';
if ~exist(DIROUT_ctimes); mkdir(DIROUT_ctimes); end
%%
for ip = 1
clear nInteractions nRegionInts SNR noise_mix nlag filtertype hemisym
[nInteractions,nRegionInts,SNR,noise_mix,nlag,filtertype, dimred] = fp_get_params(ip);
for iInt = nInteractions
for iReg = nRegionInts
for isnr = SNR
for iss = noise_mix
for ilag = nlag
for ifi = 1:numel(filtertype)
clear ifilt
ifilt = filtertype{ifi};
for iit = 1:100
iit
%create logfile for parallelization
logname = sprintf('iInt%d_iReg%d_snr0%d_iss0%d_lag%d_filt%s_%s_iter%d'...
,iInt,iReg,isnr*10,iss*10, ilag,ifilt,dimred,iit);
load([DIRIN 'mim_' logname '.mat'])
try
ta(1,iit) = t.signal;
catch
ta(1,iit) = nan;
end
try
ta(2,iit) = t.snr;
catch
ta(2,iit) = nan;
end
try
ta(3,iit) = t.filter;
catch
ta(3,iit) = nan;
end
try
ta(4:numel(t.pips)+3,iit) = t.pips;
catch
ta(4,iit) = nan;
end
try
corr_voxmim_all(iit,:) = corr_voxmim;
corr_voxmic_all(iit,:) = corr_voxmic;
end
for oo = params.pips
try
varex_all(iit,oo) = mean(to_save{oo}.varex);
end
end
end %iit
info = {'signal','snr','filter','pips'};
pips = params.pips;
outname = [DIROUT_ctimes logname '.mat'];
save(outname,'ta','info','pips','corr_voxmim_all','corr_voxmic_all', 'varex_all','-v7.3')
end %filtertype
end %lag
end %noise_mix
end %snr
end %iReg
end %iInt
end%ip