필터 지우기
필터 지우기

how to add increments to time

조회 수: 5 (최근 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 CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by