|
22 | 22 | % matrix of the design |
23 | 23 | % |
24 | 24 | % Output: |
25 | | - % - ExpParameters.designBlockNames = cell array (nr_blocks, 1) with the |
| 25 | + % - ExpParameters.design.blockNames = cell array (nr_blocks, 1) with the |
26 | 26 | % name for each block |
27 | 27 | % |
28 | | - % - ExpParameters.designDirections = array (nr_blocks, nbEventsPerBlock) |
| 28 | + % - ExpParameters.design.directions = array (nr_blocks, nbEventsPerBlock) |
29 | 29 | % with the direction to present in a given block |
30 | 30 | % - 0 90 180 270 indicate the angle |
31 | 31 | % - -1 indicates static |
32 | 32 | % |
33 | 33 | % |
34 | | - % - ExpParameters.designFixationTargets = array (nr_blocks, nbEventsPerBlock) |
| 34 | + % - ExpParameters.design.fixationTargets = array (nr_blocks, nbEventsPerBlock) |
35 | 35 | % showing for each event if it should be accompanied by a target |
36 | 36 | % |
37 | 37 |
|
|
48 | 48 |
|
49 | 49 | % Set variables here for a dummy test of this function |
50 | 50 | 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; |
53 | 53 | cfg.design.nbEventsPerBlock = 12; |
54 | 54 | cfg.target.maxNbPerBlock = 2; |
55 | 55 | end |
|
93 | 93 |
|
94 | 94 | %% Give the blocks the names with condition |
95 | 95 |
|
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); |
99 | 99 |
|
100 | 100 | for iMotionBlock = 1:nbRepetitions |
101 | 101 |
|
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); |
104 | 104 |
|
105 | 105 | end |
106 | 106 |
|
|
113 | 113 | case 'motion' |
114 | 114 | thisBlockName = {'motion'}; |
115 | 115 | end |
116 | | - cfg.designBlockNames(iBlock) = thisBlockName; |
| 116 | + cfg.design.blockNames(iBlock) = thisBlockName; |
117 | 117 |
|
118 | 118 | % set target |
119 | 119 | % if there are 2 targets per block we make sure that they are at least |
|
141 | 141 |
|
142 | 142 | end |
143 | 143 |
|
144 | | - cfg.designFixationTargets(iBlock, chosenTarget) = 1; |
| 144 | + cfg.design.fixationTargets(iBlock, chosenTarget) = 1; |
145 | 145 |
|
146 | 146 | end |
147 | 147 |
|
148 | 148 | %% Visualize the design matrix |
149 | 149 | if displayFigs |
150 | 150 |
|
151 | | - uniqueNames = unique(cfg.designBlockNames) ; |
| 151 | + uniqueNames = unique(cfg.design.blockNames) ; |
152 | 152 |
|
153 | | - Ind = zeros(length(cfg.designBlockNames), length(uniqueNames)) ; |
| 153 | + Ind = zeros(length(cfg.design.blockNames), length(uniqueNames)) ; |
154 | 154 |
|
155 | 155 | 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> |
157 | 157 | Ind(CondInd(:, i), i) = 1 ; |
158 | 158 | end |
159 | 159 |
|
|
0 commit comments