Using MATLAB & EEGLAB, I am trying to write a script that will allow me to segment the data by beginning to read the EEG at one event, such as "EV01" and continue to read until the next event, such as "EV02". The events are representing two separate stimuli, such as "EV01" (Initial Stimulus) and "EV02" (Subjects Response). However, the length in time between each event will vary based upon the individuals duration. This time in seconds may vary from 5-20 seconds for each trial and each individual. Is there a way to segment the data between two differing events, over "N" electrode channels, and across multiple trials? Also, can the said process be scripted for multiple subjects as well? Thanks.