Skip to content

Commit 08e014d

Browse files
committed
update with new var names
1 parent 8854a3a commit 08e014d

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

subfun/expDesign.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
% matrix of the design
2323
%
2424
% Output:
25-
% - ExpParameters.designBlockNames = cell array (nr_blocks, 1) with the
25+
% - ExpParameters.design.blockNames = cell array (nr_blocks, 1) with the
2626
% name for each block
2727
%
28-
% - ExpParameters.designDirections = array (nr_blocks, nbEventsPerBlock)
28+
% - ExpParameters.design.directions = array (nr_blocks, nbEventsPerBlock)
2929
% with the direction to present in a given block
3030
% - 0 90 180 270 indicate the angle
3131
% - -1 indicates static
3232
%
3333
%
34-
% - ExpParameters.designFixationTargets = array (nr_blocks, nbEventsPerBlock)
34+
% - ExpParameters.design.fixationTargets = array (nr_blocks, nbEventsPerBlock)
3535
% showing for each event if it should be accompanied by a target
3636
%
3737

@@ -48,8 +48,8 @@
4848

4949
% Set variables here for a dummy test of this function
5050
if nargin < 1 || isempty(cfg)
51-
cfg.design.names = {'static', 'motion'};
52-
cfg.design.nbRepetitions = 4;
51+
cfg.design.names = {'static', 'motion'};
52+
cfg.design.nbRepetitions = 4;
5353
cfg.design.nbEventsPerBlock = 12;
5454
cfg.target.maxNbPerBlock = 2;
5555
end
@@ -93,14 +93,14 @@
9393

9494
%% Give the blocks the names with condition
9595

96-
cfg.designBlockNames = cell(nrBlocks, 1);
97-
cfg.designDirections = zeros(nrBlocks, nbEventsPerBlock);
98-
cfg.designFixationTargets = zeros(nrBlocks, nbEventsPerBlock);
96+
cfg.design.blockNames = cell(nrBlocks, 1);
97+
cfg.design.directions = zeros(nrBlocks, nbEventsPerBlock);
98+
cfg.design.fixationTargets = zeros(nrBlocks, nbEventsPerBlock);
9999

100100
for iMotionBlock = 1:nbRepetitions
101101

102-
cfg.designDirections(motionIndex(iMotionBlock), :) = Shuffle(motionDirections);
103-
cfg.designDirections(staticIndex(iMotionBlock), :) = Shuffle(staticDirections);
102+
cfg.design.directions(motionIndex(iMotionBlock), :) = Shuffle(motionDirections);
103+
cfg.design.directions(staticIndex(iMotionBlock), :) = Shuffle(staticDirections);
104104

105105
end
106106

@@ -113,7 +113,7 @@
113113
case 'motion'
114114
thisBlockName = {'motion'};
115115
end
116-
cfg.designBlockNames(iBlock) = thisBlockName;
116+
cfg.design.blockNames(iBlock) = thisBlockName;
117117

118118
% set target
119119
% if there are 2 targets per block we make sure that they are at least
@@ -141,19 +141,19 @@
141141

142142
end
143143

144-
cfg.designFixationTargets(iBlock, chosenTarget) = 1;
144+
cfg.design.fixationTargets(iBlock, chosenTarget) = 1;
145145

146146
end
147147

148148
%% Visualize the design matrix
149149
if displayFigs
150150

151-
uniqueNames = unique(cfg.designBlockNames) ;
151+
uniqueNames = unique(cfg.design.blockNames) ;
152152

153-
Ind = zeros(length(cfg.designBlockNames), length(uniqueNames)) ;
153+
Ind = zeros(length(cfg.design.blockNames), length(uniqueNames)) ;
154154

155155
for i = 1:length(uniqueNames)
156-
CondInd(:, i) = find(strcmp(cfg.designBlockNames, uniqueNames{i})) ; %#ok<*AGROW>
156+
CondInd(:, i) = find(strcmp(cfg.design.blockNames, uniqueNames{i})) ; %#ok<*AGROW>
157157
Ind(CondInd(:, i), i) = 1 ;
158158
end
159159

0 commit comments

Comments
 (0)