0001 function PL = set_col_const(var_list)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 mappings = { ...
0030 'SUB_ID', 'Subject'; ...
0031 'TRIAL_NUM', 'Trial'; ...
0032 'EVENT_TYPE', 'Event Type'; ...
0033 };
0034
0035
0036 PL = struct('SUB_ID',[], ...
0037 'TRIAL_NUM',[], ...
0038 'EVENT_TYPE',[], ...
0039 'EVENT_CODE',[], ...
0040 'EVENT_ABSTIME',[], ...
0041 'EVENT_TTIME',[], ...
0042 'TTIME_UNC',[], ...
0043 'DUR_UNC',[], ...
0044 'REQ_TIME',[], ...
0045 'REQ_DUR',[], ...
0046 'RUN_REL_TIME',[], ...
0047 'RESP_CODE',[], ...
0048 'RESP_TIME',[], ...
0049 'RUN',[], ...
0050 'STIM_ID',[], ...
0051 'STIM_TYPE',[], ...
0052 'PAIR_IDX',[] ...
0053 );
0054
0055 nvars = length(var_list);
0056 for ivar = 1:nvars
0057 switch var_list{ivar}
0058 case {'Subject','SUB_ID'}
0059 PL.SUB_ID = ivar;
0060
0061 case {'Trial','TRIAL_NUM'}
0062 PL.TRIAL_NUM = ivar;
0063
0064 case {'Event Type','EVENT_TYPE'}
0065 PL.EVENT_TYPE = ivar;
0066
0067 case {'Code','EVENT_CODE'}
0068 PL.EVENT_CODE = ivar;
0069
0070 case {'Time','EVENT_ABSTIME'}
0071 PL.EVENT_ABSTIME = ivar;
0072
0073 case {'TTime','EVENT_TTIME'}
0074 PL.EVENT_TTIME = ivar;
0075
0076 case {'Stim Type','STIM_TYPE'}
0077 PL.STIM_TYPE = ivar;
0078
0079 case {'Pair Index','PAIR_IDX'}
0080 PL.PAIR_IDX = ivar;
0081
0082 case 'Uncertainty'
0083 switch var_list{ivar-1}
0084 case {'TTime','TTIME_UNC'}
0085 PL.TTIME_UNC = ivar;
0086 case {'Duration','DUR_UNC'}
0087 PL.DUR_UNC = ivar;
0088 otherwise
0089 fprintf('set_col_const: Uncertain about uncertainty column\n');
0090 end
0091
0092 case {'ReqTime','REQ_TIME'}
0093 PL.REQ_TIME = ivar;
0094
0095 case {'ReqDur','REQ_DUR'}
0096 PL.REQ_DUR = ivar;
0097
0098 case {'ResponseCode','RESP_CODE'}
0099 PL.RESP_CODE = ivar;
0100
0101 case {'ResponseTime','RESP_TIME'}
0102 PL.RESP_TIME = ivar;
0103
0104 case {'Run Relative Time','RUN_REL_TIME'}
0105 PL.RUN_REL_TIME = ivar;
0106
0107 case {'Run','RUN'}
0108 PL.RUN = ivar;
0109
0110 case {'stimulus id','stimulus_id','stim_id','STIM_ID'}
0111 PL.STIM_ID = ivar;
0112
0113 end
0114 end
0115
0116 return