0

I have a EEG data of length "x" with a corresponding time events of interest. I have attached the annotation of the events. Basically it should read the start date-time, event and end date-time. The final binary annotation should be of length "x" with the locations of event marked as "1". This means that when there is an event, the array should contain '1' and the remaining locations as '0'. Can someone help me with this?

Start time: 2015-01-28 02:10:23
End time: 2015-01-29 13:54:10 

           Date      start Time    End time


Event   2015-01-28   03:40:18      03:50:28
Event   2015-01-28   05:04:43      07:40:10 
Event   2015-01-28   08:47:10      09:25:00
Event   2015-01-28   12:27:11      13:36:28
Event   2015-01-28   21:26:47      23:10:38 
Event   2015-01-29   00:17:12      03:10:58
Event   2015-01-29   05:20:04      07:40:48
Event   2015-01-29   09:23:08      10:30:40
Sowmya
  • 29
  • 6
  • Your example looks like a text file, is this right? First step would be to parse it using `textscan` or similar, then converting the strings to a date using `datenum`. This process should end with a 2 column matrix with start and end. – Daniel Apr 07 '15 at 19:56
  • For the output vector, a resolution of 1s? So a 5 second event would create five `1` – Daniel Apr 07 '15 at 19:57
  • Hi Daniel, I am new to MATLAB so not really sure how to do this. The raw data is recorded at 256hz. – Sowmya Apr 07 '15 at 20:00
  • What have you tried? Have you looked at the basic text input tutorials on Mathworks (`csvread`, `importdata`, `dlmread`)? Stackoverflow isn't a site where you ask for code to be written for you, even though people here are often nice enough to do it. – Setsu Apr 07 '15 at 20:12
  • @Sowmya: How should 03:40:18 - 03:40:28 be represented in your output file? How many `1`? That's what I mean with resolution. Please try parsing the data on your own, everything you need is well documented. If you have some specific problem please ask mode detailed question including your code. Then converting it to a 0/1 vector is basically [runlength decoding](http://stackoverflow.com/questions/28501418/run-length-decoding-in-matlab). – Daniel Apr 08 '15 at 19:32

0 Answers0