function svmEciton(subject,number,EEG,k,maxExpC,maxPerClass,poolObj)
    load(sprintf('/nfs/wsi/ti/messor/hohlochj/matlabData/%s%i200msWindowEMG1sWindowEEG200msShift1sPauseFreq0to200.mat',subject,number));
    addpath('/nfs/wsi/ti/messor/hohlochj/libsvm/matlab');
    %k=2;
    %maxExpC=0; % c\in {2^i|i=-maxExpC:1:maxExpC}

    %choose to estimate based on EEG or EMG
    if EEG
        trainingData=trainingDataEEG;
    else
        trainingData=trainingDataEMG;
    end
    clear trainingDataEEG;
    clear trainingDataEMG;
    addAttachedFiles(poolObj,'classification');
    addAttachedFiles(poolObj,'trainingData');

    accurancy=zeros(k,3);
    maxC=zeros(k,1);
    noClasses=size(unique(classification),1);
    cm=zeros(noClasses);
    randMap=randperm(size(trainingData,1));
    disp('startCV')
    parfor i=1:k
        leaveOut=trainingData(mod(randMap,k)==i-1,:,:);
        leaveClasses=classification(mod(randMap,k)==i-1);
        remaining=trainingData(mod(randMap,k)~=i-1,:,:);
        remainingClasses=classification(mod(randMap,k)~=i-1);
        disp(datestr(datetime('now')))
        fprintf('create %ith model\n',i)
        [model,maxC(i)]=kfoldCV(remainingClasses,remaining,k,maxExpC,maxPerClass);
        disp(datestr(datetime('now')))

        [predictions,accurancy(i,:),~]=svmpredict(leaveClasses,leaveOut(:,:),model);
        cm=cm+confusionmat(leaveClasses,predictions); %confusion matrix
        %cf: for each cue what was the prediction (maybe colourCoded)
    end
    meanAccurancy=mean(accurancy(:,1))

    fig=figure;
    cmScaled=zeros(size(cm));
    for i=1:size(cm,1)
        cmScaled(i,:)=cm(i,:)/sum(cm(i,:));
    end
    imagesc(cmScaled)
    colorbar();
    saveas(fig,sprintf('/nfs/wsi/ti/messor/hohlochj/plots/%s%i%icm200ms1sPause.fig',subject,number,EEG),'fig');
    save(sprintf('/nfs/wsi/ti/messor/hohlochj/matlabData/%s%i%i200ms1sPause.fig',subject,number,EEG),'meanAccurancy','maxC','cmScaled');
end
