Download scripts/buildTestTrials.m from jalauer/Brown2020: direct link, hf CLI and curl.
- Browser
- Download file 997 Bytes
-
https://huggingface.co/datasets/jalauer/Brown2020/resolve/main/scripts/buildTestTrials.m
- Command line
-
hf download hf://datasets/jalauer/Brown2020/scripts/buildTestTrials.m
-
curl -L -o buildTestTrials.m https://huggingface.co/datasets/jalauer/Brown2020/resolve/main/scripts/buildTestTrials.m
997 Bytes
| function trials = buildTestTrials(disp_struct, task_struct) | |
| % full cross-combination of all stimuli | |
| [p,q] = meshgrid(1:length(task_struct.pWin), 1:length(task_struct.pWin)); | |
| pairs = repmat([p(:) q(:)], 2, 1); | |
| % remove stimuli paired with themselves | |
| pairs( pairs(:,1) == pairs(:,2), : ) = []; | |
| % double the bias pairs | |
| pairs = [pairs; repmat([1 2 3 4; 5 6 7 8]', 4, 1)]; | |
| % define the trials | |
| trials = nan(size(pairs, 1), task_struct.cRT); | |
| trials(:, task_struct.cBlock) = 0; | |
| trials(:, task_struct.cTrialNum) = 1:size(trials, 1); | |
| trials(:, task_struct.cTrialID) = 1:size(trials, 1); | |
| trials(:, task_struct.cTrialCond) = task_struct.FC; | |
| trials(:, task_struct.cTrialType) = task_struct.TEST; | |
| trials(:, task_struct.cS1) = pairs(:, 1); | |
| trials(:, task_struct.cS2) = pairs(:, 2); | |
| trials(:, task_struct.cIsS1Left) = rand(size(trials, 1), 1) > 0.5; | |
| % randomize | |
| trials = trials(randperm(size(trials,1)), :); | |
| end % function |