You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
initial_wait =5; % seconds to have a blank screen at the beginning, the scans will be discarded until % the magnetic field is homogenous
32
+
finalWait =5;
33
+
%blockDur = 16; % Block duration [should be a multiple of osc (below)]
34
+
ISI =0.1; % Interstimulus Interval between events in the block.
35
+
ibi =6; % Inter-block duration in seconds (time between blocks)
36
+
nrBlocks =14; % Number of trials , where 1 block = 1 block of all conditions (static and motion)
37
+
numEventsPerBlock =12;
38
+
range_targets = [02]; % range of number of targets in each block (from 2 to 5 targets in each block)
39
+
40
+
mirror_width=11.5; % Width (x-axis) of the mirror (in cm)
41
+
v_dist =14; % viewing distance from the mirror (cm) "in this script we use mirror"
42
+
fix_r =0.15; % radius of fixation point (deg)
43
+
44
+
%Audiofile_duration = 16 ; % Length of the Audio file (in seconds)
45
+
%Stop_audiofile = blockDur ; % Let the audio file play for x Seconds
46
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % 1 Cycle = one inward and outward motion together
47
+
%%Experimental Design
48
+
% function "experimental_design" while assign the blocks, conditions, and
49
+
% the number of targets that will be used in the motion localizer
%%Save the results ('names','onsets','ends','duration') of each block
275
+
names = cell(length(timeLogger.block),1);
276
+
onsets = zeros(length(timeLogger.block),1);
277
+
ends = zeros(length(timeLogger.block),1);
278
+
durations = zeros(length(timeLogger.block),1);
279
+
280
+
for i=1:length(timeLogger.block)
281
+
names(i,1) =timeLogger.block(i).names;
282
+
onsets(i,1) =timeLogger.block(i).startTime;
283
+
ends(i,1) =timeLogger.block(i).endTime;
284
+
durations(i,1) =timeLogger.block(i).length;
285
+
end
286
+
287
+
%%KeyPresses and Times
288
+
% for i=length(responseKey):-1:2 % responseKey gives a '1' in all frames where button was pressed, so one motor response = gives multiple consequitive '1' frames
289
+
% if responseKey(i-1)~=0 % therefore, we need to cancel consequitive '1' frames after the first button press
290
+
% responseKey(i)=0; % we loop through the responses and remove '1's that are not preceeded by a zero
291
+
% responseTime(i)=0; % this way, we remove the additional 1s for the same button response
292
+
% end % - The same concept for the responseTime
293
+
% end
294
+
%
295
+
% for i=length(targetTime):-1:2 % The same concept as responseKey adn responseTime.
296
+
% if targetTime(i-1)~=0 % Our Targets lasts 3 frames, to remove the TargetTime for the 2nd and 3rd frame
297
+
% targetTime(i)=0; % we remove targets that are preceeded by a non-zero value
298
+
% end % that way, we have the time of the first frame only of the target
299
+
% end
300
+
%
301
+
% responseKey = responseKey(responseKey > 0); % Remove zero elements from responseKey, responseTime, & targetTime
0 commit comments