Newer
Older
masterarbeit / CD / matlabCode / readEMGSig.m
@Jan-Peter Hohloch Jan-Peter Hohloch on 22 Nov 2016 548 bytes final
function [EMG]=readEMGSig(pathToFile,subject,number,maxFile,windowEMG,windowShift,EMGChannels)
% readEMGSig reads the EMG only
    EMGcell=cell(maxFile,1);
    
    for i=1:maxFile
        [sig, ~, params] = load_bcidat(strcat(pathToFile,...
            sprintf('%s/%s_B100%i/%s_B1S00%iR0%i.dat',subject,subject,number,subject,number,i)));
        EMGcell{i}=waveformLengthAll(sig(:,ismember(params.ChannelNames.Value,EMGChannels)),...
            params.SamplingRate.NumericValue,windowEMG,windowShift);
    end
    
    EMG=cell2mat(EMGcell);
end