I have two datetime vectors of un equal lengths that I need to compare. One issue is they also have diferent degrees of accuracey, one is to the second and one to the minute, and I have multiple points per minute making using a function like synchronize difficult to use. I would like to align the data such that if the day hour and minute are equal then the sampled points are next to each other in the table, and if one set has fewer points than the other, the missing data is replaced with NaN. For instance If I have a set of data from 1/1/17 from 00:00:00 to 1/1/17 00:30:00 sampling every 20 seconds and another set from 1/1/17 00:00 to 1/1/17 00:30 with two to three points per minute sampled randomly without recording the seconds, is there a way I can put both data sets in one table with teh first and second sets aligned to the minute, and any point missing from the second set replaced with NaN? so it would look something like:
date Value_A Value_B
1/1/17 00:00 5 6
1/1/17 00:00 7 9
1/1/17 00:00 2 NaN
1/1/17 00:01 8 3
Best Answer