pb_vStoreData.m 1.45 KB
Newer Older
Jesse Heckman's avatar
Jesse Heckman committed
1
function handles = pb_vStoreData(handles, data)
2
3
4
5
6
% PB_VSTOREDATA(HANDLES, DATA)
%
% PB_VSTOREDATA(HANDLES, DATA)  stores all the trial data and configurements 
% on a trial basis in organized vc-files.
%
Jesse Heckman's avatar
Jesse Heckman committed
7
% See also PB_VPRIME, PB_VPRIMEGUI, PB_VRUNEXP, PB_TDTINIT
8
9
10
11
12
13
14
15
16

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

   cfg = handles.cfg;
   cd([cfg.dname filesep 'trial'])

   [~,prefix]        = pb_fext(cfg.fname);
   fname             = [prefix '-' num2str(cfg.trialnumber(2),'%04d') '.vc'];
   
Jesse Heckman's avatar
Jesse Heckman committed
17
   data = data;                        %% TO DO: <-- FIX: SELECT DATA FOR TRIAL ONLY
Jesse Heckman's avatar
Jesse Heckman committed
18
   beta  = setCFG(cfg);                %% TO DO: <-- FIX: SELECT CFGs FOR TRIAL ONLY
19
   
Jesse Heckman's avatar
Jesse Heckman committed
20
   save(fname,'data', 'beta', '-mat');
21
22
23
24
   
   handles.cfg = cfg;
end

Jesse Heckman's avatar
Jesse Heckman committed
25
function beta = setCFG(cfg)
Jesse Heckman's avatar
Jesse Heckman committed
26
27
28
29
30
31
   % stores relevant handles into a new trial cfg
   
   beta   = struct('blocknumber',[],...
                  'trialnumber',[],...
                  'vestibularsignal',[],...
                  'nstim',[],...
Jesse Heckman's avatar
Jesse Heckman committed
32
                  'stim',[]);
Jesse Heckman's avatar
Jesse Heckman committed
33
34
35
36
37
               
   beta.blocknumber = cfg.blocknumber;
   beta.trialnumber = cfg.trialnumber;
end

38
39
40
41
42
43
44
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 
%                                                           %
%       Part of Programmeer Beer Toolbox (PBToolbox)        %
%       Written by: Jesse J. Heckman (2018)                 %
%                                                           %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %