-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute_gains.m
49 lines (43 loc) · 1.4 KB
/
compute_gains.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
function[totalGain] = compute_gains()
%[totalGain] = compute_gains()
% function to compute the total final gains
%
% OUTPUTS
% totalGain: amount of money the participant should be paid in the end
%% enter subject ID
% subject = 'CID0XX';
subjectId = [];
while isempty(subjectId)
info = inputdlg({'Subject CID (XXX)'});
subjectId = ['CID',info{[1]}];
end
%% go to subject path
cd ..
rootPath = [pwd, filesep];
subPath = [rootPath,'LGC_Motiv_results',filesep,subjectId,filesep,'behavior',filesep];
%% load data
totalGain = 0;
% compute money gained during the task
nRuns = 4;
for iRun = 1:nRuns
filenm = ls([subPath,subjectId,'_session',num2str(iRun),'_*_task_behavioral_tmp.mat']);
sessionGain = getfield(getfield(load([subPath,filenm],'summary'),'summary'),'totalGain');
totalGain = totalGain + sessionGain(end);
end
% add money acquired during IP
filenm = ls([subPath,'delta_IP_',subjectId,'.mat']);
totalGain = totalGain + getfield(getfield(load([subPath,filenm]),'IP_variables'),'totalGain');
% add the other resources
MRStunes = 35;
IRMftunes = 35;
MVCtune = 48;
timeTune = input('time money?');
questionnairesTune = 10; % like 1h exp
% pilots
% MRStunes = 0;
% IRMftunes = 0;
% MVCtune = 12;
% timeTune = 0;
% questionnairesTune = 0; % like 1h exp
totalGain = totalGain + MRStunes + IRMftunes + MVCtune + timeTune + questionnairesTune;
end % function