Merge dataset with different lengths

1 回表示 (過去 30 日間)
Jesper Solheimsnes
Jesper Solheimsnes 2021 年 3 月 25 日
回答済み: dpb 2021 年 3 月 25 日
Hi all,
I have 3 datasets with returns from the indexes; DAX, SP500 and NIKKEI I want to merge.
They all start from February 21st 2021, but the tables are in different lengths. e.g. the DAX index length is 8550, NIKKEI 14443 and SP500 is 23407.
I want to merge these 3 tables from 21st of February back to the first period in time which I have data for all three tables jointly.
i.e. I want to merge the data such that my table consists of all 3 returns ranging from 21st of february 2021, with a length of 8550.
I have an additional column in all three tables with dates which I can use as a "reference" to sort the data, but I am not able to figure out how.
Can anyone help me?

採用された回答

dpb
dpb 2021 年 3 月 25 日
TT = synchronize(DAX,SP500,'intersection');
TT = synchronize(TT,NIKKEI,'intersection');
where DAX, SP500 and NIKKEI are the three timetables you have.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeTables についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by