-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathwrapper.m
119 lines (86 loc) · 2.27 KB
/
wrapper.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
% wrapper for Stanford PTB tasks
function wrapper()
clear;
clc;
PsychJavaTrouble
pwd
path.main = pwd;
exptname = 'stanfordPTB';
[pathstr,curr_dir,ext] = fileparts(pwd);
if ~strcmp(curr_dir,'Stanford-PsychToolBox')
error('You must start the experiment from the Stanford-PsychToolBox directory. Go there and try again.\n');
end
javaaddpath('.');
% define and add standard paths
path.data = fullfile(path.main, 'data');
path.diaries = fullfile(path.main, 'diaries');
path.stim = fullfile(path.main, 'functions/stim');
addpath(path.stim)
addpath(path.data)
addpath(path.diaries)
%
% % specify experiment paths here
% path.SSRT = fullfile(path.main, 'stopsig_behav');
% path.expexp = fullfile(path.main, 'expexp');
%
% % Add relevant paths for this experiment
% addpath(path.SSRT)
% addpath(path.expexp)
% start the experiment!
fprintf('Welcome!\n');
subjNo = input('What is the subject number? (0-99): ');
% extra inputs needed?
order = input('SSRT order? (1-4): ');
% check for existing file for that subject
cd(path.data);
savename = [exptname num2str(subjNo) '.mat'];
if (exist(savename,'file'))>0
cd(path.main)
sca
end
% set up diary
diarySetup(path.diaries, [exptname num2str(subjNo)])
% %%%% run main tasks %%%% %
data = [];
c = exptSetup;
c.path = path;
% add session specific data
c.subjNo = subjNo;
c.exptname = exptname;
% % SSRT
% cd(path.SSRT)
% stopbehavOSX_2stairs_GT(path, subjNo, order)
%
% % expexp -tested
% cd(path.expexp)
% expexp(path,subjNo)
% % temporal discounting - unsorting is working
% [g, TDdata] = temporalDiscounting(c);
% BISBAS -- stanford PTB toolbox should be in path
%[BASDrive, BASFS, BASRewRes, BIS, rating] = BISBAS(c);
% Frost indecisiveness
%[frostScore, frostRating] = FrostIndecisiveness(c);
% Eriksen Flanker Task
% [EriksenData] = EriksenFT(c);
% data.EriksenFT = EriksenData;
% Go Nogo task
%[gonogoData] = gonogo(c);
%data.gonogo = gonogoData;
%
% save data
% data.g = g;
% data.TDdata = TDdata;
% data.BASDrive = BASDrive;
% data.BASFS = BASFS;
% data.BASRewRes = BASRewRes;
% data.BIS = BIS;
% data.rating = rating;
%
% data.frostScore = frostScore;
% data.frostRating = frostRating;
cd(path.data)
savename = [exptname num2str(subjNo) '_order' num2str(order) '.mat'];
save(savename, 'data');
ListenChar(0)
sca
end