diff --git a/usedMcode/callAll.m b/usedMcode/callAll.m index cc1ae66..76a725d 100644 --- a/usedMcode/callAll.m +++ b/usedMcode/callAll.m @@ -45,10 +45,11 @@ number=numbersMat(j); subject=subjectsForNumbers{j}; readEEG(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause); - [meanAccurancysEMG(j),maxCEMG(j,:),cmScaledEMG(j,:,:)]=svmEciton(pathToFile,subject,number,~EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause); - [meanAccurancysEEG(j),maxCEEG(j,:),cmScaledEEG(j,:,:)]=svmEciton(pathToFile,subject,number,EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause); - [correlationEMG(j,:)]=ridgeCV(pathToFile,subject,number,false,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause); - [correlationEEG(j,:)]=ridgeCV(pathToFile,subject,number,EEG,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause); + [meanAccurancysEMG(j),maxCEMG(j,:),cmScaledEMG(j,:,:)]=svmEciton(pathToFile,subject,number,~EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pburgOrder); + [meanAccurancysEEG(j),maxCEEG(j,:),cmScaledEEG(j,:,:)]=svmEciton(pathToFile,subject,number,EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pburgOrder); + [correlationEMG(j,:)]=ridgeCV(pathToFile,subject,number,false,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pburgOrder); + [correlationEEG(j,:)]=ridgeCV(pathToFile,subject,number,EEG,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pburgOrder); + fprintf('%s%i finished %s\n',subject,number,datestr(datetime('now'))) end save(strcat(pathToFile,sprintf('../matlabData/%s_callAll.mat',datestr(datetime('now'))))); diff --git a/usedMcode/readEEG.m b/usedMcode/readEEG.m index 8a9b347..a60b41f 100644 --- a/usedMcode/readEEG.m +++ b/usedMcode/readEEG.m @@ -43,7 +43,7 @@ kinematics=kinMat(smoothClassification~=-1,:); clear smoothClassification i - save(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShift1sPauseFreq%ito%iPause%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause)),'trainingDataEEG','trainingDataEMG','classification','kinematics','-v7.3'); + save(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShiftFreq%ito%iPause%ipBurg%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause,pburgOrder)),'trainingDataEEG','trainingDataEMG','classification','kinematics','-v7.3'); %fprintf('finished reading %s%i %s\n',subject,number,datestr(datetime('now'))); diff --git a/usedMcode/ridgeCV.m b/usedMcode/ridgeCV.m index ee1fc2a..fa5f021 100644 --- a/usedMcode/ridgeCV.m +++ b/usedMcode/ridgeCV.m @@ -1,5 +1,5 @@ -function [correlation]=ridgeCV(pathToFile,subject,number,EEG,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause) - load(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShift1sPauseFreq%ito%iPause%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause))); +function [correlation]=ridgeCV(pathToFile,subject,number,EEG,k,ridgeParams,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pBurgOrder) + load(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShiftFreq%ito%iPause%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause,pBurgOrder))); clear classification; if EEG trainingData=trainingDataEEG; diff --git a/usedMcode/svmEciton.m b/usedMcode/svmEciton.m index b575127..268f704 100644 --- a/usedMcode/svmEciton.m +++ b/usedMcode/svmEciton.m @@ -1,5 +1,5 @@ -function [meanAccurancy,maxC, cmScaled]= svmEciton(pathToFile,subject,number,EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause) - load(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShift1sPauseFreq%ito%iPause%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause))); +function [meanAccurancy,maxC, cmScaled]= svmEciton(pathToFile,subject,number,EEG,k,maxExpC,maxPerClass,windowEMG,windowEEG,shift,minEEGFreq,maxEEGFreq,pause,pBurgOrder) + load(strcat(pathToFile,sprintf('../matlabData/%s%i%imsWindowEMG%isWindowEEG%imsShiftFreq%ito%iPause%ipBurg%i.mat',subject,number,windowEMG*1000,windowEEG,shift*1000,minEEGFreq,maxEEGFreq,pause,pBurgOrder))); % fprintf('%i,%i,%i',size(trainingDataEMG,1),size(trainingDataEEG,1),size(classification,1)) addpath('/nfs/wsi/ti/messor/hohlochj/libsvm/matlab'); @@ -43,5 +43,4 @@ % colorbar(); %saveas(fig,strcat(pathToFile,sprintf('../plots/%s%i%icm200ms1sPause.fig',subject,number,EEG)),'fig'); %save(strcat(pathToFile,sprintf('../matlabData/%s%i%i200ms1sPause.mat',subject,number,EEG)),'meanAccurancy','maxC','cmScaled','-v7.3'); - fprintf('%s%i%i finished %s\n',subject,number,EEG,datestr(datetime('now'))) end