How to Create a hystogram based on a timetable?

3 次查看(过去 30 天)
Hi, I have a time table that contains data from 28 days from 3 engines.
I have group them and synchronized them but I am having issues to create an histogram showing hours of engine activity per day. Engine activity is showed by engine load. therefore something like if Engine1Load>0, then engine1 is on. This should be done for the 3 engines and duration should be extracted from Absolute time.
Table looks something like this
Absolute Time Engine1Load Engine2Load Engine3Load
2020-02-18 17:58:11 NaN 40 NaN
2020-02-18 17:58:12 NaN 40 45
2020-02-18 17:58:13 NaN 40 45
2020-02-19 19:20:00 NaN 40 45
2020-02-19 19:20:01 15 40 45
2020-02-19 19:20:02 30 40 NaN
and the histogram would be something like this, in this case this is seconds, I want to do it in hours
Any ideas?
Thanks

回答(1 个)

Gargi Patil
Gargi Patil 2021-3-26
You can create stacked graphs using bar graphs. You can refer to the following documentation for implementation details: https://www.mathworks.com/help/matlab/ref/bar.html#bthxce9
You can also refer to a similar question on stacked histograms that has been answered: https://www.mathworks.com/matlabcentral/answers/293124-how-to-stack-hist

类别

Help CenterFile Exchange 中查找有关 Histograms 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by