MATLAB: Missing data, time series

MATLABmissing datatime series

I am recording groundwater level at hourly intervalls using a data logger. I have data from 31 May 2017 09:00 hrs until 3 May 2019 03:00 hrs.
I noticed there are missing data as the total number of records should be 16843.
I generate a timeseries bb=[a1:ap:ae]; covering the indicated period where a1=datenum(2017,5,31,9,0,0), ap=datenum(0,0,0,1,0,0) and ae=datenum(2019,5,3,3,0,0) which gives the length of the time series being 16843
I read the logger data from excel into matlab with date in first column aa(:,1) while the second column (aa(:,2) contains the recorded logger data. I convert the Excel data to matlab data.
How can I now merge the data from aa with the dates in bb so that a second column (bb(:,2) has the reccorded logger data merged/combined with the correct date.
thanks before hand
Johannes

Best Answer

All you need to do is call retime and tell it what you want the new time v ecgtor to be. Sometimes it's as simple as 'hourly', other times you'll need to create a time vector yourself. It sounds like you want every hour represented. 'hourly' does that.