%%% Making data
clear trials classes parameterSets;

load_eegdata;

subject = 1
tasks = [1 2 3 4 5]
%tasks = [2 3]
trials = 1:5
trials = squeeze(eegdata(subject,tasks,trials));
% Remove EOG channel
[nr,nc] = size(trials);
for r = 1:nr
  for c = 1:nc
    trials{r,c} = trials{r,c}(1:6,:);
  end
end

classes = repmat((1:length(tasks))',1,length(trials));

%%% Setting up matrix of parameter values
lags = 0:2:32;
nchannels = 6;
k = 0;
for nl = lags
  k = k + 1;
  parameterSets(k).nlags = nl;
end

%%% Run all experiments
CV = general(trials,classes,parameterSets,0.2,5,...
    @makeRawEEGFeatures,@LDA,@selectSamples);
  

%%% Display results

summarizeTestResults(CV);
