Azzera filtri
Azzera filtri

how to add increments to time

5 visualizzazioni (ultimi 30 giorni)
liu James
liu James il 19 Lug 2017
Risposto: Peter Perkins il 19 Lug 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?

Risposte (1)

Peter Perkins
Peter Perkins il 19 Lug 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);

Categorie

Scopri di più su Dates and Time in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by