How can I convert number to time?
7 次查看(过去 30 天)
显示 更早的评论
I have a column of data ranging from 1 to 58,232 that represents time. 10 units represents 1 second, I need to convert this column into Minutes:seconds:milliseconds so that it is easier to understand when it comes to plotting the data set on to a graph. Would anyone know how I would be able to achieve this?
Thanks, Jack.
0 个评论
回答(1 个)
Star Strider
2020-2-13
If you have R2015b or later, this is straightforward:
v = 1:58232;
tsec = seconds(v/10);
Show = tsec(1:18) % Sample Result (Delete)
producing:
Show =
1×19 duration array
Columns 1 through 9
0.1 sec 0.2 sec 0.3 sec 0.4 sec 0.5 sec 0.6 sec 0.7 sec 0.8 sec 0.9 sec
Columns 10 through 18
1 sec 1.1 sec 1.2 sec 1.3 sec 1.4 sec 1.5 sec 1.6 sec 1.7 sec 1.8 sec
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!