I have several matrices containing recording of a physical quantity and a timestamp of when the recording was taken (technically at a fixed frequency). The problem is that even though the observation time is the same for all the different sensors, the total number of elements in each matrix is different. Since we are talking about hundreds of thousands of recordings, I can only guess some recordings are not there and therefore I end up with fewer elements than I should. I would like to scan the times, detect if any is missing and in that case perform interpolation in-between the two closest values to fill the gap. The first problem I am encountering is converting the time stamps into a format that is easily manipulated in Matlab. The format I have in the database is MM/DD/YYYY HH:MM:SS AM. Matlab will not recognize this as a date and time and therefore I am not able to perform any operations on the vector. The second problem would be to find the missing items and perform oversampling based on the values I have. The easiest way would be to simply interpolate between the prior and subsequent value found in the time stamp. My date vector would look something like this:
A = ['01/01/2017 00:00:00 AM'; '01/01/2017 00:15:00 AM'; '01/01/2017 00:30:00 AM'; '01/01/2017 01:00:00 AM'];
and obviously the missing item would be 00:45:00AM on 01/01/2017.
Best Answer