I am completely new to MATLAB, and I am having some difficulty. I have a 64x430250 matrix with EEG data, from which i need to extract all data corresponding to the latency events of interest. I have a vector (EEG.times, 1x430250) containing all the sampling times, vectors for the latencies of the different events themselves, and need to extract data from -200ms to 800ms around the event. I have also created vectors containing the start/end times for each of the variables if that should make anything easier. So if the startT is equal to EEG.times, extract the corresponding data in EEG.data (all rows, column startT:endT), and store it in a new variable (preferably a 3d matrix). I know I should end up with a 64x250x96 (as i know there are 96 events). Can someone help me?