-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetSubjectIdx.m
More file actions
29 lines (25 loc) · 837 Bytes
/
getSubjectIdx.m
File metadata and controls
29 lines (25 loc) · 837 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
function [subjectIdx] = getSubjectIdx()
% Get SubjectIdx
userInput = inputdlg({'Enter subjectIdx (num):'},'SubjectIdx',1);
if isempty(userInput)
error('No subjectIdx provided.');
end
subjectIdx = str2double(userInput{1});
ImgPerms = getImgPerms();
if (subjectIdx < 1) || (subjectIdx > size(ImgPerms,2)) ||...
isnan(subjectIdx) || ...
(round(subjectIdx)~=subjectIdx)
error('subjectIdx must be a strictly positive integer < %i.',...
size(ImgPerms,2)+1);
end
% Confirm details
ConfStr = sprintf(...
['Experiment ready to begin...%c',...
'subjectIdx: %02d%c',...
'Is this detail correct and do you wish to continue?'],...
10,subjectIdx,10);
ConfirmDlg = questdlg(ConfStr,'Confirm details','YES','NO','NO');
if ~strcmp(ConfirmDlg,'YES')
error('Script terminated by user!');
end
return