The easiest approach is to create a for loop over the events
Nevents = nume(EventTimes)
R = zeros(64, 250, Nevents)
for k = 1:Nevents
TF = EEG.Times > EventTimes(k)-200 & EEG.Times < EventTimes(k) + 800 ;
R(:,:,k) = EEG.data(: , TF) ;
end
However, this will fail if there if for some events the number of samples within the time window is not the same ... You should think how you want to deal with these events.
Best Answer