I am using a code that gives the times at which an event starts, peaks, and ends. (the result is shown in the pic attached). now i want to separate each event into different variables that has all the timesteps between start and end of the event . the code gives start time for each event in one vector variable called (shloc), end times of each event in another vector variable called (ehloc). the hole dataseries has 43 start points and end points. so i need to get 43 vectors for each event otomatically. if possible in one for loop command. could anyone help with this please?