I had time 21:09 and i want to generate previous 10 time events like 21:08 to 20:59. so how to implement?
2 views (last 30 days)
Show older comments
johnphilip bhimavarapu
on 8 Feb 2016
Commented: johnphilip bhimavarapu
on 12 Feb 2016
I used datenum but the difference between them is not same
0 Comments
Accepted Answer
Joseph Cheng
on 8 Feb 2016
Edited: Joseph Cheng
on 8 Feb 2016
the units of datenum are in days so you need to subtract by the fraction of day.
datestr(datenum('21:09')-1/24/60,15) %will return 21:08
so
datestr(datenum('21:09')-[0:10]/24/60,15)
will generate the past 10 times
More Answers (0)
See Also
Categories
Find more on Time Series Objects in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!