pb_vPrimeZ.m 1.39 KB
Newer Older
1
function block = pb_vPrimeZ(block,cfg)
2
% PB_VPRIMEZ
3
%
4
% PB_VPRIMEZ(block, cfg) adds additional fields to 'block' in order to
5
% allow for TDT control of correct LSCs during experimentation. 
6
%
7
% See also PB_VPRIME, PB_VPRIME, PB_VRUNEXP, PB_GETBLOCK, PB_VREADEXP
8
9
10
11

% PBToolbox (2018): JJH: j.heckman@donders.ru.nl

   for iBlck = 1:cfg.Blocks
12
      
13
14
      ntrls = length(block(iBlck).trial);
      for iTrl = 1:ntrls
15
         
16
17
         nstms = length(block(iBlck).trial(iTrl).stim);
         for iStm = 1:nstms
18
            
19
20
21
22
            X = block(iBlck).trial(iTrl).stim(iStm); 
            if ~isempty(X)
               
               ZI = cfg.interpolant(block(iBlck).trial(iTrl).stim(iStm).azimuth,block(iBlck).trial(iTrl).stim(iStm).elevation);
23
               
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
               block(iBlck).trial(iTrl).stim(iStm).Z           = ZI;
               block(iBlck).trial(iTrl).stim(iStm).azimuth   	= cfg.lookup(ZI+1,4);
               block(iBlck).trial(iTrl).stim(iStm).elevation	= cfg.lookup(ZI+1,5);
            end
         end
      end
   end
end
 
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 
%                                                           %
%       Part of Programmeer Beer Toolbox (PBToolbox)        %
%       Written by: Jesse J. Heckman (2018)                 %
%                                                           %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %