how to replace Table_A withTable_B based on their corresponding date?

1 回表示 (過去 30 日間)
ehsan
ehsan 2019 年 2 月 7 日
コメント済み: Star Strider 2019 年 2 月 7 日
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 件のコメント
Cris LaPierre
Cris LaPierre 2019 年 2 月 7 日
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 2019 年 2 月 7 日
@Chris — Since you consider it a ‘good solution’, I copied it to an Answer. Thank you!

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2019 年 2 月 7 日
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.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by