Hey all! I have an array which I will call as "spiketimes''. It's essentially an array consisitng of time points, from ~0.1 secs to ~4.5 secs. Now I have another array called "eyetimes", also consisting of time points. What I ultimately want to do is to select values of the "eyetimes" array based on the values of the "spiketimes" array and how I want to go about this is to implement a "moving window" of sorts.
For eg, the first window will take a window of 0.2 secs in the "spiketime" array from the start (0.0 secs) till about 0.2 secs. Based on this selection, I need to select the value of the "eyetimes" array right before this window.
The second window will now offset the starting point by 0.05 secs such that the starting point will now be at 0.05 secs and the end point will be at 0.25 secs, while keeping the same interval of 0.2 secs. Again I need to select the value of "eyetimes" before the start of the second window.
Likewise, the third window will start at 0.1 secs and end at 0.3 secs and so on...
This continues till the end of the array contents, offsetting the start of the window by 0.05 secs, while still maintaining the interval of 0.2 secs. What might be the best way to go about this? Thanks in advance!
Edited: attached .mat files for both "spiketimes" and "eyetime"