Creating histogram from a datetime vector
显示 更早的评论
Hello guys!
I was trying to plot a datetime arrangement (vector) in a 12-hour histogram.
The problem is that when I try to plot it, it considers the whole date (since each element has a dd-MM-yy HH:mm:ss format), so I was wondering if is possible to isolate the hour in order to get an histogram that shows the hourly frecuency in a single day (only considering the hour). Another option I was considering is transforming the HH element into another data type easier to plot, but once again, I am not sure how to do it.
Thank you in advance,
Carlos.
采纳的回答
更多回答(1 个)
rightNow = datetime('now')
howLongSinceMidnight = timeofday(rightNow)
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!