Exporting boundary events created in EEGLAB

조회 수: 1 (최근 30일)
Ludovica Garritano
Ludovica Garritano 2023년 9월 23일
답변: Sachin Lodhi 2023년 10월 4일
Hi, I'd like to export to a .txt file the boundary events with their latencies and duration form EEG struct of EEGLAB. In the field EEG.event there's the field 'type' in which all events are present: boundary, square and rt. How do I extract only the boundary ones?

답변 (1개)

Sachin Lodhi
Sachin Lodhi 2023년 10월 4일
Hi Ludovica,
Based on my understanding, it seems that you are seeking guidance on extracting latencies and durations of events with type as boundary. You can use the provided code as a starting point and make the necessary custom changes to suit your specific requirements:
EEG=struct;
EEG.event(1).type = 'square';EEG.event(1).position = 1;EEG.event(1).latencies = rand;EEG.event(1).urevent = 2 * rand; EEG.event(1).duration = 4 * rand;
EEG.event(2).type = 'boundary';EEG.event(2).position = 2;EEG.event(2).latencies = rand;EEG.event(2).urevent = 2 * rand; EEG.event(2).duration = 4 * rand;
EEG.event(3).type = 'rt';EEG.event(3).position = 3;EEG.event(3).latencies = rand;EEG.event(3).urevent = 2 * rand; EEG.event(3).duration = 4 * rand;
EEG.event(4).type = 'boundary';EEG.event(4).position = 3;EEG.event(4).latencies = rand;EEG.event(4).urevent = 2 * rand; EEG.event(4).duration = 4 * rand;
EEG = struct with fields:
event: [1×4 struct]
L=ismember({EEG.event.type},{'boundary'});
exportedData = [EEG.event(L).latencies; EEG.event(L).duration]'
exportedData = 2×2
0.3033 3.6549 0.3962 1.9749
Then you can export the ‘exportedData’ to the .txt file. I hope this helps you in exporting your data.
Best Regards,
Sachin

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by