how to add increments to time

8 ビュー (過去 30 日間)
liu James
liu James 2017 年 7 月 19 日
回答済み: Peter Perkins 2017 年 7 月 19 日
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?

回答 (1 件)

Peter Perkins
Peter Perkins 2017 年 7 月 19 日
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);

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by