Clear Filters
Clear Filters

how to add increments to time

5 views (last 30 days)
liu James
liu James on 19 Jul 2017
Answered: Peter Perkins on 19 Jul 2017
Is there a way to fill timetable time column continuously? Currently, the time table data have one column of times, where the time is not continuous. In other words there are times in there that jump from
'04-Jan-2016 07:31:41.500'
'04-Jan-2016 08:59:00.500'
'04-Jan-2016 09:00:00.500'
'04-Jan-2016 09:00:01.000'
I would like to fill in the time with increments of 0.5 milliseconds.
'04-Jan-2016 07:31:41.500'
'04-Jan-2016 07:31:42.000'
'04-Jan-2016 07:31:42.500'
'04-Jan-2016 07:31:43.000'
.
.
.
.
'04-Jan-2016 09:00:00.500'
'04-Jan-2016 09:00:01.000'
I'm not sure how to do this. Further, is there a way to add 500milliseconds to the end of a datenum?

Answers (1)

Peter Perkins
Peter Perkins on 19 Jul 2017
You are showing text. A timetable's row times are not text, they would be (in your case) datetimes.
retime is the way to synchronize a timetable to a regularly-spaced time vector.
You are asking about datenums, but again, a timetable uses datetimes. Not sure what you mean by "add to the end", but if tt is your timetable, and you've used the default name for the row times, you may be looking for
tt.Time = tt.Time + milliseconds(500);

Categories

Find more on Dates and Time in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!