Info

This question is closed. Reopen it to edit or answer.

How to get the index from a datetime array corresponding to a time duration?

1 view (last 30 days)
Hi I am trying to get the starting and ending index from a datetime array that corresponds to a specific time duration.
Find below my code for a general datetime array
t1 = datetime('23-Feb-2015 09:43:08')
num=2000
t2 = t1 + seconds(1:num)
I am interested in getting the starting and ending index from t2 with a time step durations of 5min.
index1=starting and ending index from t2 which corresponding to first 5 min.
index2=starting and ending index from t2 which corresponding to next 5 min .
.
.
.
index= starting and ending index from t2 which corresponds to remaining time.
I tried something using "minutes" but i do not know how to access the starting and ending index from t2. Can you please help?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!