Associate value to the correct date
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Francesco Panico
el 2 de Mzo. de 2019
Respondida: Eric Sofen
el 3 de Mzo. de 2019
Hi, I have 4 lists
1st ,2nd and 3rd -> composed by column : Date and Value (some date missing)
4th --> a coloumn of the complete list of date
I'd like to obtain a matrix made by the column : Date (complete, from 4th) , Value1, Value2, Value3. Each value mast be associated correctly to it's date. When a value for a date is absent , write NaN.
How can I do ? thanks for your answer.
Example : ![matlab.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/206545/matlab.png)
![matlab.png](https://www.mathworks.com/matlabcentral/answers/uploaded_files/206545/matlab.png)
0 comentarios
Respuesta aceptada
Eric Sofen
el 3 de Mzo. de 2019
Take a look at the timetable synchronize method. If you import your "1st", "2nd", "3rd" as separate timetables tt1,tt2,tt3, then you can do:
tt = synchronize(tt1,tt2,tt3,'regular','TimeStep',dt)
The default method for filling in time when there's no data is 'fillwithmissing', which i what you want.
0 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!