From 2c6201fbd5ce8d7c3606c80bb96a37193557ae39 Mon Sep 17 00:00:00 2001 From: Jasper Date: Sun, 9 Sep 2018 18:26:22 +0100 Subject: [PATCH 1/3] example code to import eeg data --- eeg.m | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 eeg.m diff --git a/eeg.m b/eeg.m new file mode 100644 index 0000000..5df6ba4 --- /dev/null +++ b/eeg.m @@ -0,0 +1,18 @@ +dataroot = '/media/charesti-start/data/irsa-eeg/BIDS/derivatives/eegprep/'; +% trials x channels x timepoints +data = load(fullfile(dataroot, 'sub-01', 'sub-01_task-irsa_epo.mat')); + + +% conditions = unique(data.events); +% dims = size(data.epochs); +% nconditions = numel(conditions); +% nchannels = dims(2); +% ntimepoints = dims(3); +% data_reshaped = zeros([nchannels ntimepoints nconditions ntrials??]); +% %reshape to electrodes x time x conditions x trials +% for c=1:length(conditions) +% disp(c); +% end +% %B = permute(A,[3 2 1]); + + From e58bb7e04ea507049183d38c40bd21c2772e9085 Mon Sep 17 00:00:00 2001 From: Jasper Date: Sun, 9 Sep 2018 18:48:22 +0100 Subject: [PATCH 2/3] plotting epochs --- eeg.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eeg.m b/eeg.m index 5df6ba4..c584c5c 100644 --- a/eeg.m +++ b/eeg.m @@ -2,6 +2,8 @@ % trials x channels x timepoints data = load(fullfile(dataroot, 'sub-01', 'sub-01_task-irsa_epo.mat')); +% plot grand average per trial +plot(squeeze(mean(data.epochs, 1)).'); % conditions = unique(data.events); % dims = size(data.epochs); From a7ff4422e90fa5d50feb0399ddf443af750ecdab Mon Sep 17 00:00:00 2001 From: Jasper Date: Sun, 9 Sep 2018 18:51:35 +0100 Subject: [PATCH 3/3] fixed plot comand --- eeg.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eeg.m b/eeg.m index c584c5c..0e6bfff 100644 --- a/eeg.m +++ b/eeg.m @@ -2,7 +2,7 @@ % trials x channels x timepoints data = load(fullfile(dataroot, 'sub-01', 'sub-01_task-irsa_epo.mat')); -% plot grand average per trial +% butterfly plot across trials plot(squeeze(mean(data.epochs, 1)).'); % conditions = unique(data.events);