EEG plot without toolbox

6 次查看(过去 30 天)
I have my EEG data with 59 channels [(my_data is a 1619936x54 vector) ,fs=200] and a vector called markers (1x202) which have the events timepoints. How can i plot the events from one channel. I chose POz channel which is the 56 column of my data so:
chanPOz =my_data( :, 56);
plot(chanPOz(27900:28000),'b')
set(gca,'ylim',[0 100],'xlim',[0 50]);
The first element of markers is 27965 so i plot the channel between 27000 &28000 but obviously that is uncorrect

采纳的回答

Walter Roberson
Walter Roberson 2018-1-25
selection_idx = 27900:28000;
timevec = (selection_idx - 1) / fs; %the -1 is because time is assumed to start at 0
plot(timevec, chanPOz(selection_idx), 'b');
marker_to_idx = round(markers * fs) + 1; %the +1 is because time is assumed to start at 0
mask = ismember(marker_to_idx, selection_idx);
selected_markers_idx = marker_to_idx(mask);
selected_markers_time = markers(mask);
selected_markers_y = chanPOz(selected_markers_idx);
plot(selected_markers_time, selected_markers_y, 'r*'); %plot markers as red *

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 EEG/MEG/ECoG 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by