Borrar filtros
Borrar filtros

how to add increments to time

5 visualizaciones (últimos 30 días)
liu James
liu James el 19 de Jul. de 2017
Respondida: Peter Perkins el 19 de Jul. de 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?

Respuestas (1)

Peter Perkins
Peter Perkins el 19 de Jul. de 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);

Categorías

Más información sobre Dates and Time en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by