-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_TbTresponses.m
32 lines (31 loc) · 1.01 KB
/
make_TbTresponses.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
maindir = pwd;
sublist = [1002 1003 1005:1024];
count = 0;
for s = 1:length(sublist)
if sublist(s) == 1011 || sublist(s) == 1014 || sublist(s) == 1020
continue
end
subj = num2str(sublist(s));
for r = 1:4
clear netbetas
data = load(fullfile(maindir,'DR_output_n19',sprintf('dr_stage1_subject%05d.txt',count)));
count = count + 1;
design = load(fullfile(maindir,'fsl',subj,['trialdata_run' num2str(r) '.mtx']));
design = design(:,9:end);
nodata = ~any(design);
mytrials = [nodata; 1:40]';
mytrials(mytrials(:,1)==1,:) = [];
design = design(:,~nodata);
for n = 1:10
stats = regstats(zscore(data(:,n)),design,'linear','all');
b = stats.beta(2:end);
if n == 1
netbetas = [mytrials(:,2) b];
else
netbetas = [netbetas b];
end
end
fname = ['NetAffect_sub' subj '_run' num2str(r) '.mat'];
save(fname,'netbetas')
end
end