Commit eda33323 authored by Jesse Heckman's avatar Jesse Heckman
Browse files

vPrime update

parent a6a8f79b
......@@ -7,8 +7,7 @@ function pb_vPrime()
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
pb_vPrimeGUI;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
......
......@@ -143,7 +143,8 @@ function buttonRun_Callback(hObject, eventdata, handles)
Exp.expfile = get(handles.editLoad,'string');
Exp.recording = get(handles.editRec,'string');
disp(['Experimentor: ' Exp.experimenter newline 'Expfile: ' Exp.expfile newline 'Subject ID: ' Exp.SID newline 'Recording: ' Exp.recording newline]);
disp(['Experimenter: ' Exp.experimenter newline 'Expfile: ' Exp.expfile newline 'Subject ID: ' Exp.SID newline 'Recording: ' Exp.recording newline]);
pb_vRunExp(Exp,handles)
end
end
......
function [exp,cfg] = pb_vReadExp(expfile)
% PB_VREADEXP()
%
% PB_VREADEXP() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
%% INITIALIZE
if ~pb_fexist(expfile); return; end
fid = fopen(expfile,'r');
%% READ HEADER
cfg = hread(fid);
exp = eread(fid);
%% CHECK OUT
fclose(fid);
end
function header = hread(fid)
tline = fgetl(fid);
while ~contains(tline,'%% HEADER') % find header
tline = fgetl(fid);
end
tmp = fgetl(fid);
header.ITI = [];
end
function experiment = eread(fid)
experiment = fid;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
function pb_vRunExp(varargin)
function pb_vRunExp(Exp,h)
% PB_VRUNEXP(varargin)
%
% PB_VRUNEXP() forms the core body of experimental paradigms in the VC, and
......@@ -12,20 +12,26 @@ function pb_vRunExp(varargin)
%% INITIALIZE
% load & read experiment
experiment = pb_vReadExp;
ntrials = length(experiment);
[experiment, cfg] = pb_vReadExp(Exp.expfile); % struct
nblocks = cfg.nblocks;
nTotTrials = cfg.ntrials;
%% BODY
% iterate experiment
for iTrial = 1:ntrials
pb_vClearTrial();
pb_vRecordData();
pb_vRunTrial(experiment(iTrial));
for iBlock = 1:nblocks
nTrials = Experiment(iBlock).info.ntrials; % ntrials in block
signal = Experiment(iBlock).info.veststim; % IMPORTANT: veststim has to be a struct with hor and vert component!
for iTrial = 1:nTrials
%pb_vClearTrial();
%pb_vRecordData();
%pb_vRunTrial(experiment(iTrial));
%pb_vFeedbackGUI();
end
......
function whitespace()
% WHITESPACE()
%
% WHITESPACE() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
function bool = pb_fexist(fn)
% PB_FEXIST()
%
% PB_FEXIST() ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
bool = exist(fn, 'file') == 2;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment