How to synchronize two different timetable (Each has a different time format)
    3 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Jingyu Yang
 il 23 Ago 2020
  
    
    
    
    
    Commentato: Cris LaPierre
    
      
 il 29 Ago 2020
            How to add dates to an already created timetable?
Timeline = xlsread('Timeline.xlsx');
Lidar_DeltaT = Timeline(2, 1);
GPS_DeltaT = Timeline(3, 1);
Lidar_Distance= readtimetable('Lidar Cycle.txt');
summary(Lidar_Distance);
Lidar_Distance.Time = Lidar_Distance.Time + seconds(Lidar_DeltaT);
GPS_Velocity = readtimetable('GPS cycle 1.txt');
summary(GPS_Velocity)
GPS_Velocity.Time = GPS_Velocity.Time + seconds(GPS_DeltaT);
TT_Sync = synchronize(Lidar_Distance, GPS_Velocity, 'Uniform');
with it, 
Lidar_Distance timetable look like this : 

And GPS_Velocity timetable look like this : 

I want to synchronize two time tables. But It fails every time because of time format difference. 
I don't know how to settle this two timetables into one timetable.
And I also want to set the reference time format of the two timetables to GPS. This is because the GPS time interval is tighter. After that, I want to make two timetables into one, and treat the missing data in the Lidar_Distance timetable as a value of '0'.
(This is because the GPS_Velocity data is consistently recorded in units of 1 second, while the Lidar_Distance data sometimes skips 2 seconds.)
Risposta accettata
  Cris LaPierre
    
      
 il 23 Ago 2020
        
      Modificato: Cris LaPierre
    
      
 il 23 Ago 2020
  
      Did you see the answer I provided in your previous post? It contains a solution for this. For Lidar Cycle.txt, read in the date as a datetime, the time of day as a duration, and add date and time together.
At the end of my code, I uses synchronize to combine the two timetables, and the plot velocity and distance vs time using yyases..
4 Commenti
Più risposte (0)
Vedere anche
Categorie
				Scopri di più su Programmatic Scenario Authoring in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!