Plot of a Time Variable
显示 更早的评论
Hi,
so I have a variable that has the time of arrival of different messages from 00:00:00 to 23:59:59. What I want is to get a figure of bars where each bar has the messages from an Hour. There would be a total of 24 bars.
How could I do it?
4 个评论
Mathieu NOE
2021-10-14
hello
so you want to plot a histogram ?
Lei Hou
2021-10-18
Hi Vicente,
Are you looking for this?
>> bar(duration([1 2 3],0,0),[5 1 10])

Thanks,
Lei
flashpode
2021-10-18
flashpode
2021-10-18
回答(1 个)
KSSV
2021-10-18
0 个投票
As you have data every second, you need to do hourly mean to get 24 values. You have two options.
- Reshape the data into 24*m; use mean and then plot the data.
- USe retime to get hourly average and then plot.
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!