load('/home/jph/Uni/masterarbeit/evaluation.mat')

%% compare forms of recording
eegAcc=struct2array(accuracys.EEG);
emgAcc=struct2array(accuracys.EMG);
LFAcc=struct2array(accuracys.LF);

anova1([eegAcc(1:5),emgAcc(1:5),LFAcc(1:5)],[0,0,0,0,0,1,1,1,1,1,2,2,2,2,2])
xlabel('EEG - EMG - LF')
ylabel('% classified correctly')
title('ANOVA for EEG, EMG and LF')

%% evaluate single form of recording
input=accuracys.LF;
sizeY=2;
limits_y=[100,0];

names=fieldnames(input);
noOfPlots=size(names,1);

for i=1:noOfPlots
    limits_y=[min(min(input.(sprintf('%s',names{i}))),limits_y(1)),...
        max(max(input.(sprintf('%s',names{i}))),limits_y(2))];
end
limits_y=[limits_y(1)-0.1*diff(limits_y),limits_y(2)+0.1*diff(limits_y)]

figure();

for i=1:noOfPlots
    subplot(sizeY,ceil(noOfPlots/sizeY),i)
    boxplot(input.(sprintf('%s',names{i})))
    title(names{i})
    ylim(limits_y)
end

anova1(cat(2,input.default3Syn,input.offset1Syn3,input.offset2Syn3,input.pause1Syn3,input.pause1Off1Syn3),[0,0,0,1,1])
anova1(cat(2,input.default3Syn,input.offset1Syn3,input.pause1Syn3,input.pause1Off1Syn3),[0,1,0,1])
