Skip to content

Commit 3a85ab7

Browse files
committed
factor out getDesigInput
1 parent 698708e commit 3a85ab7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

subfun/expDesign.m

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
fprintf('\n\nCreating design.\n\n');
6464

65-
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK, MAX_TARGET_PER_BLOCK] = getInput(cfg);
65+
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK, MAX_TARGET_PER_BLOCK] = getDesignInput(cfg);
6666
[~, STATIC_INDEX, MOTION_INDEX] = assignConditions(cfg);
6767

6868
if mod(NB_REPETITIONS, MAX_TARGET_PER_BLOCK) ~= 0
@@ -128,7 +128,7 @@
128128

129129
[MOTION_DIRECTIONS, STATIC_DIRECTIONS] = getDirectionBaseVectors(cfg);
130130

131-
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK] = getInput(cfg);
131+
[NB_BLOCKS, NB_REPETITIONS, NB_EVENTS_PER_BLOCK] = getDesignInput(cfg);
132132

133133
[~, STATIC_INDEX, MOTION_INDEX] = assignConditions(cfg);
134134

@@ -169,16 +169,10 @@
169169

170170
end
171171

172-
function [nbBlocks, nbRepet, nbEventsBlock, maxTargBlock] = getInput(cfg)
173-
nbRepet = cfg.design.nbRepetitions;
174-
nbEventsBlock = cfg.design.nbEventsPerBlock;
175-
maxTargBlock = cfg.target.maxNbPerBlock;
176-
nbBlocks = length(cfg.design.names) * nbRepet;
177-
end
178172

179173
function [conditionNamesVector, STATIC_INDEX, MOTION_INDEX] = assignConditions(cfg)
180174

181-
[~, nbRepet] = getInput(cfg);
175+
[~, nbRepet] = getDesignInput(cfg);
182176

183177
conditionNamesVector = repmat(cfg.design.names, nbRepet, 1);
184178

subfun/getDesignInput.m

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function [nbBlocks, nbRepet, nbEventsBlock, maxTargBlock] = getDesignInput(cfg)
2+
nbRepet = cfg.design.nbRepetitions;
3+
nbEventsBlock = cfg.design.nbEventsPerBlock;
4+
maxTargBlock = cfg.target.maxNbPerBlock;
5+
nbBlocks = length(cfg.design.names) * nbRepet;
6+
end

0 commit comments

Comments
 (0)