Create a table with timedate and values
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Tiago Dias
el 5 de Abr. de 2018
Comentada: Tiago Dias
el 6 de Abr. de 2018
Hello,
I got 2 mat files:
- old.mat that is 432x2 with time date 01/01/2016 05:00:00 with an interval of 1 minute in each row and a variable X in the 2nd column;
- new that is a 423x3, with time in the 1st column and values for variables Y1 and Y2, in the 2nd and 3rd column
Objective newtable(:,1) = old(:,1); newtable(:,2) = old(:,2); newtable(:,3:4) = new (:,2:3)
I tried newtable = [old(:,1:2) new(:,2:3)] but i got an error:
All inputs must be datetimes or date/time character vectors or date/time strings.
0 comentarios
Respuesta aceptada
Peter Perkins
el 6 de Abr. de 2018
It's pretty much impossible to say for sure what you're doing wrong without knowing what's in those mat files, but based on the error you show, it seems like you have a datetime variable and are trying to horzcat it with either a table or a numeric matrix. If variables is a numeric matrix, use array2timetable on your matrix with t_ref as the row times. If it's a table, use table2timetable.
2 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!