How to define a time array with equal increment
9 次查看(过去 30 天)
显示 更早的评论
Hi I need to define a duration array with equal increments
for example duration = [00:00:00 00:05:00 00:10:00 00:15:00 00:20:00 00:25:00....................23:55:00]
how can I do this in MATLAB
Thanks
0 个评论
采纳的回答
Star Strider
2015-12-3
One possibility:
start = fix(now);
increment = 5/(60*24); % Five-Minute Increments
time_vct = 0:increment:(1-increment); % Vector
time_str = datestr(start + time_vct, 'HH:MM:SS'); % Date Strings
ViewResult = [time_str(1:5,:); time_str(end-4:end,:)]
ViewResult =
00:00:00
00:05:00
00:10:00
00:15:00
00:20:00
23:35:00
23:40:00
23:45:00
23:50:00
23:55:00
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Structures 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!