joining two timetables to complete the timeseries

2 visualizaciones (últimos 30 días)
Muhammad Haris Siddiqui
Muhammad Haris Siddiqui el 20 de Nov. de 2021
Respondida: Peter Perkins el 23 de Nov. de 2021
I have two timetables Allyears1 and TS. Allyears1 contains the whole time series with nans and TS contains the missing values of Allyears1.
I want to join these timetable complete the time series
I have tried as shown below but it is not joing the timetables rather just showing in a timetable.
Any help would be appreciated
Thanks

Respuestas (2)

KSSV
KSSV el 20 de Nov. de 2021
You can fill the NaN values using fillmissing. Read about it.
  3 comentarios
KSSV
KSSV el 21 de Nov. de 2021
What happened when you have used outerjoin ? It is the function to be used to join two tables.
Muhammad Haris Siddiqui
Muhammad Haris Siddiqui el 21 de Nov. de 2021
I used outer join, inner join, left join, Synchronize, merge all are just showing all the columns in a single timetable as shown in my question.
out of compulsion, I used for loop to join the table.
anyways thank you the comments.

Iniciar sesión para comentar.


Peter Perkins
Peter Perkins el 23 de Nov. de 2021
Muhammad, join is sort of like a horizontal concatenation operation. That is not, I think, what you are looking for. You say
I have two timetables Allyears1 and TS. Allyears1 contains the whole time series with nans and TS contains the missing values of Allyears1.
but it's not clear what you mean by that. You might mean (1) that TS.Allyears1 contains rowtimes that are not contained in Allyears1, but the union of the two disjoint sets is your complete time series. You might mean (2) that TS.Allyears has rowtimes thjat are also in Alyears1, and in the latter the datavalues are missing inn those rows. Those are very different things.
In any case, you don't want a horz cat, and all those things you tried are essentially that. But there's no reason to use a loop. Use vertcat for (1), then sortrows. Use assignment for (2), something like
Allyears.VarName35(TS.Allyears.Date) = TS.Allyears.TS
But this is all just guesswork. Provide more details.

Categorías

Más información sobre Data Type Identification en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by