Divide histogram bins by time
13 views (last 30 days)
So I have processed data and want to present it as frequency over time. I used datenum to get timevectors but I don't know how to chose the binwidth to encompass one month since month is irregular. The code below does plot it in time but I am not sure how the values like "737287" referes to a particular date. Dividing a year by 12 would also be sufficient as it is not very important which month it is but I have failed in this as well. The starting/end dates is not static either as more data will come.
Any help would me much appreciated.
Thank you in advance.
TimeNS = datenum(NotScaled(:,3), 'dd-mm-yyyy')
h1 = histogram(Time)
Star Strider on 23 Jun 2021
I am not certain what the data are, however a histogram may not be appropriate. Instead, counting the data between two dates or averaging them using a timetable and the retime function may do what you want.
Since you are using datenum and datetick, you may not have these functions. If so, there are alternate approaches, such as combining unique and accumarray that would work instead.