private/calculateMultiSubjectDecodePerformance.m
aaaeb6c5
 %% subject loop
 function decode = calculateMultiSubjectDecodePerformance(header,subjectdata,svmopts)
 
 decode = struct;
 decode.decodePerformance = [];
 decode.rawTimeCourse     = [];
 
feeb21e9
 nSubjects = numel(subjectdata);
7984c76d
 
feeb21e9
 disp(sprintf('batch processing %g subjects',nSubjects));
f7802160
 
feeb21e9
 for subjectDataID = 1:nSubjects
aaaeb6c5
 %     SubjectID = cell2mat(subjectCell);
     currentSubject = subjectdata{subjectDataID};
 
     namehelper = strcat('s',currentSubject.name); %Vars can not start with numbers.
 
     display(sprintf('calculating cross-validation performance time-shift for Subject %s. Please Wait. ...',currentSubject.name));
feeb21e9
 %     display('switching off all warnings');
 %     warning_state               = warning('off','all');
aaaeb6c5
     display('calculating ...');
     
d0eb71ff
         decode.(namehelper)         = calculateDecodePerformance(header,currentSubject,svmopts);
aaaeb6c5
 
     display('... done');
feeb21e9
 %     display('restoring warnings');
 %     warning(warning_state);
aaaeb6c5
 
     decode.decodePerformance    = [decode.decodePerformance decode.(namehelper).decodePerformance];
     decode.rawTimeCourse        = [decode.rawTimeCourse decode.(namehelper).rawTimeCourse];
 
     assignin('base','decode',decode);
 end
 
 end