how to replace Table_A withTable_B based on their corresponding date?

1 Ansicht (letzte 30 Tage)
I have two tables, Table_A with 11322x281 dimension with NaN values, and Table_B with 322x281 with valus. The first, second and third rows are assigned for years, months and days.
As can be seen, Table_B starts from 0.1.04.2014 to 26.02.2015 as follow:
year Mounth Day station1 station2
____ ______ ___ ____________________ ____________________ .......
2014 4 1 0 0
2014 4 2 0 1.0644
2014 4 3 9.8287 6.8423
2014 4 4 0.094507 0.15205
2014 4 5 3.1187 0.076026
...........
while Table_A contains just NaN values and starts from 01.01.1985 to 31.12.2015 as follow:
year Mounth Day N1 N2
____ ______ ___ ___ ___ ..........
1985 1 1 NaN NaN
1985 1 2 NaN NaN
1985 1 3 NaN NaN
1985 1 4 NaN NaN
1985 1 5 NaN NaN
...............
Now, I would like to replace the values of Table_B into Table_A in their corresponding Year, Months and Days.
I am stuck on this part . I appreciate any help.
  3 Kommentare
Cris LaPierre
Cris LaPierre am 7 Feb. 2019
Star Strider - you should put your answers in an answer instead of comments. That way the question can be marked as answered, helping others with a similar question find questions with good solutions.
Star Strider
Star Strider am 7 Feb. 2019
@Chris — Since you consider it a ‘good solution’, I copied it to an Answer. Thank you!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Star Strider
Star Strider am 7 Feb. 2019
I would first convert the tables to the timetable (link) data type (that means you will have to convert your three date columns to datetime objects). Then it will be straightforward for you to combine them using the various join (link) function options.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by