Combining multiple tables with same variable

Day1 of using Matlab I have managed to pull in data from an outside vendor that is organized like this
Data1 = 1×5 cell array {50×2 table} {50×2 table} {50×2 table} {50×2 table} {50×2 table}
Each 50x2 table has a date column first followed by a price column "S" is a 1x5 cell containing the source name of each price
How do I combine this into a single table that includes the date and appropriate name and reads left to right Date|Name1|Name2|Name3|Name4|Name5
Thanks

回答 (2 件)

Star Strider
Star Strider 2018 年 11 月 9 日

0 投票

One option is vertcat (link), another is join (link).

2 件のコメント

Guillaume
Guillaume 2018 年 11 月 9 日
I think join is more likely to be what the OP is after or even possibly outerjoin.
Another option would be to convert to timetable with table2timetable then synchronize.
Star Strider
Star Strider 2018 年 11 月 9 日
@Guillaume — Thank you!

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

Peter Perkins
Peter Perkins 2018 年 11 月 15 日

0 投票

If there's really only 5, just rename the variables and horzcat, and I guess also leave out the date var from all but one. I guess maybe S is a separate cell array containing the names of each price? So use that to modify the var names. But your description is not at all clear.

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

製品

リリース

R2018b

質問済み:

2018 年 11 月 9 日

回答済み:

2018 年 11 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by