function retval = RadialProfile(Events,X,Y,radii,t0,t1)
% usage: retval = RadialProfile(Events,X,Y,radii,t0,t1)
% description: returns a single profile of events between t0 and t1
% in Events sorted into to the "bins" defined by node vector radii
% where center of radial coordinates is at (X,Y)

[retval,idx] = sort(Events(:,3));
retval = Events(idx,:);
retval = [abs((retval(:,1)-X)+1i*(retval(:,2)-Y)),retval(:,3)];
retval = retval(retval(:,2) > t0 & retval(:,2) <= t1,1);
retval = histc(retval,radii);
retval = retval(:)'; % make sure it's a row
