EEG plot without toolbox
조회 수: 3 (최근 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
댓글 수: 0
채택된 답변
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!