How to generate timetable with microsecond accuracy

조회 수: 7 (최근 30일)
Liam Bullard
Liam Bullard 2020년 12월 20일
답변: Steven Lord 2020년 12월 20일
I have some sensor data with a sample rate of 1kHz to include in a timetable. As it is now, the duration object required by the timetable does not support the precision I am providing (i.e 100.1000 and 100.1010 are both displayed as 100.1 sec).
The timetable is gererated like this, where probeTime is a vector containing timestamps in seconds, to 4 decimal places
probeTT = timetable(seconds(probeTime), U, gamma, theta, uu, vv, ww);
Is there a way of fixing this, aside from using datetime objects instead of seconds?
  댓글 수: 1
Walter Roberson
Walter Roberson 2020년 12월 20일
Set the Format property of the duration objects you are creating.

댓글을 달려면 로그인하십시오.

답변 (1개)

Steven Lord
Steven Lord 2020년 12월 20일
dt = datetime('now')
dt = datetime
20-Dec-2020 16:46:07
dt.Format = dt.Format + ".SSSSSS"
dt = datetime
20-Dec-2020 16:46:07.059265

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by