Skip to content

Commit 928663b

Browse files
committed
add new function for expDesign that could be just a sandbox at the moment
1 parent 74361c8 commit 928663b

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

subfun/expDesignMtMst.m

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% (C) Copyright 2021 CPP visual motion localizer developpers
2+
3+
function [cfg] = expDesignMtMst(cfg, displayFigs)
4+
5+
%% Check inputs
6+
7+
% Set to 1 for a visualtion of the trials design order
8+
if nargin < 2 || isempty(displayFigs)
9+
displayFigs = 0;
10+
end
11+
12+
% Set variables here for a dummy test of this function
13+
if nargin < 1 || isempty(cfg)
14+
error('give me something to work with');
15+
end
16+
17+
fprintf('\n\nCreating design.\n\n');
18+
19+
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK, MAX_TARGET_PER_BLOCK] = getDesignInput(cfg);
20+
[~, CONDITON1_INDEX, CONDITON2_INDEX] = assignConditions(cfg);
21+
22+
if mod(NB_REPETITIONS, MAX_TARGET_PER_BLOCK) ~= 0
23+
error('number of repetitions must be a multiple of max number of targets');
24+
end
25+
26+
RANGE_TARGETS = 1:MAX_TARGET_PER_BLOCK;
27+
targetPerCondition = repmat(RANGE_TARGETS, 1, NB_REPETITIONS / MAX_TARGET_PER_BLOCK);
28+
29+
numTargetsForEachBlock = zeros(1, NB_BLOCKS);
30+
numTargetsForEachBlock(CONDITON1_INDEX) = shuffle(targetPerCondition);
31+
numTargetsForEachBlock(CONDITON2_INDEX) = shuffle(targetPerCondition);

0 commit comments

Comments
 (0)