diff --git a/usedMcode/callAll.m b/usedMcode/callAll.m index d25121e..371b7a4 100644 --- a/usedMcode/callAll.m +++ b/usedMcode/callAll.m @@ -1,10 +1,11 @@ addpath('/home/hohlochj/masterarbeit/usedMcode') pathToFile='/nfs/wsi/ti/messor/hohlochj/origData/'; %pathToFile='/home/jph/Uni/masterarbeit/Block1_ReachingMovements/'; - maxFile=5; threshold=10000; %EMG is classified as movement +allSubjects=true; %run all subjects and days or only one random day for one random subject + windowEMG=0.2; %try 1s windowEEG=1; shift=0.2; @@ -41,7 +42,22 @@ correlationEMG=zeros([j,3]); %x,y,angle correlationEEG=zeros([j,3]); -parfor j=1:size(numbersMat,2) +if allSubjects + parfor j=1:size(numbersMat,2) + number=numbersMat(j); + subject=subjectsForNumbers{j}; + savePath=readEEG(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause); + [meanAccurancysEMG(j),maxCEMG(j,:),cmScaledEMG(j,:,:)]=svmEciton(savePath,~EEG,k,maxExpC,maxPerClass); + [meanAccurancysEEG(j),maxCEEG(j,:),cmScaledEEG(j,:,:)]=svmEciton(savePath,EEG,k,maxExpC,maxPerClass); + [correlationEMG(j,:)]=ridgeCV(savePath,false,k,ridgeParams); + [correlationEEG(j,:)]=ridgeCV(savePath,EEG,k,ridgeParams); + fprintf('%s%i finished %s\n',subject,number,datestr(datetime('now'))) + end + + save(strcat(pathToFile,sprintf('../matlabData/%s_callAll.mat',datestr(datetime('now'))))); +else + j=rand()*size(numbersMat,2)+1; + number=numbersMat(j); subject=subjectsForNumbers{j}; savePath=readEEG(pathToFile,subject,number,windowEMG,windowEEG,shift,maxFile,threshold,pburgOrder,minEEGFreq,maxEEGFreq,pause); @@ -50,9 +66,9 @@ [correlationEMG(j,:)]=ridgeCV(savePath,false,k,ridgeParams); [correlationEEG(j,:)]=ridgeCV(savePath,EEG,k,ridgeParams); fprintf('%s%i finished %s\n',subject,number,datestr(datetime('now'))) + + save(strcat(pathToFile,sprintf('../matlabData/%s_call%s%i.mat',datestr(datetime('now')),subject,number))); end - -save(strcat(pathToFile,sprintf('../matlabData/%s_callAll.mat',datestr(datetime('now'))))); delete(poolObj)