clear, load eeg %% data import and plot plot(time, mean(control'), time, mean(data')) xlabel('Time (ms)'), ylabel('EEG (mV)') legend({'Control','Stimulus'}) %% estimate dimension and delay for embedding mi(control(:,1),10) fnn(control(:,1)) %% RQA step = 10; for i=1:7, waitbar(i/7) rqaControl(:,:,i) = crqa(control(:,i),3,1,.1,'fan',60,step,'sil','non'); end for i=1:5, waitbar(i/5) rqaData(:,:,i) = crqa(data(:,i),3,1,.1,'fan',60,step,'sil','non'); end %% plot the results % single trial result k = 3; % select which RQA measure is shown plot(time(1:step:size(rqaControl)), rqaControl(1:step:end,k,2), ... time(1:step:size(rqaData)), rqaData(1:step:end,k,2)) xlabel('Time (ms)'), legend({'Control','Stimulus'}) % mean result k = 2; % select which RQA measure is shown plot(time(1:step:size(rqaControl)), mean(rqaControl(1:step:end,k,:),3), ... time(1:step:size(rqaData)), mean(rqaData(1:step:end,k,:),3)) xlabel('Time (ms)'), legend({'Control','Stimulus'})