Plot time-of day histogram for array of datetimes
20 views (last 30 days)
Show older comments
How do I create a histogram for an array of datetimes showing the counts of times of day from 00:00 to 24:00. I'd like the bin width to be variable between 1 to 60 minutes.
0 Comments
Accepted Answer
dpb
on 1 Oct 2025 at 19:01
6 Comments
dpb
ongeveer 17 uur ago
No problem -- I should have recalled the timeofday function; subtracting the base datetime for each day is what it does. Seems like maybe when the datetime class was first introduced it wasn't yet there, maybe, is why I fixated on using the duration class; I don't recall precisely. I do remember there being an Answers Q? quite a long time ago about creating some specialized plots that the poster had initially done with datenum required recasting; maybe that recollection got me sidetracked.
Anyways, glad you looked in more depth on your own...
More Answers (0)
See Also
Categories
Find more on Data Distribution Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!