Preserve data time format while using num2str
Tue, 10/05/2021 - 06:57 am
I have a 1 month long time series. What I need to determine is how this data behaves on average every 1 hour of a 24-hour day. So I want to end up with mean and standard deviation values for each hour going from 0 to 23. One may image a plot where the x-axis is Hour of day going from 0 to 23, and the y axis would be mean and SD derived over a 1 month period.
Now the issue is that the datetime numeric wave is not consistent throughout. Meaning, for some days, some hours are missing, on other days, only 40 minutes (random value) of data is available for an hour etc. On some days, entire hours are missing.
I'm trying to figure out a smart way to do this. Currently I'm writing a brute force algorithm which is splitting the data into multiple waves where each wave corresponds to a particular day of the month. Then I want the program to go through the wave, averaging values that have the same "hour" value on their timestamp. To do this, I want to use num2str(timewave), and then grep the common hour indices out. But when I run num2str, it gives me a text wave containing large values in seconds. I want to retain the date time format in the text wave.
Kindly advise how to retain the format in text datetime wave, or also if you know of a better, simpler way (some libraries I may not have dug into yet) to pull off this whole task.
Thanks a lot,