How can I convert cell to a timetable?
    14 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Ashfaq Ahmed
      
 el 24 de Mzo. de 2023
  
    
    
    
    
    Editada: Walter Roberson
      
      
 el 24 de Mzo. de 2023
            Hi all, I have a table that is consists of both double (temperature, salinity) and cell array (sampling time). But I want to convert the table into a time timetable making sure that the time column is no longer a cell array, rather it is in a datetime format = YY:MM:DD HH:MM:SS.
 
  I have attached the .mat file. Can anyone please help?
0 comentarios
Respuesta aceptada
  Walter Roberson
      
      
 el 24 de Mzo. de 2023
        
      Editada: Walter Roberson
      
      
 el 24 de Mzo. de 2023
  
      times = datetime(YourCell{:,4}, 'InputFormat', "yyyy-MM-dd'T'hh:mm:ss'Z'", 'TimeZone', 'GMT');
data = table2timetable(cell2table(YourCell(:,[1:3,5:end])), 'RowTimes', times);
0 comentarios
Más respuestas (0)
Ver también
Categorías
				Más información sobre Tables en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

