EEG plot without toolbox

3 ビュー (過去 30 日間)
Greg Athanasiadis
Greg Athanasiadis 2018 年 1 月 25 日
回答済み: Walter Roberson 2018 年 1 月 25 日
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 Center および File ExchangeEEG/MEG/ECoG についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by