Combining multiple tables together

12 ビュー (過去 30 日間)
Alex Herron
Alex Herron 2019 年 6 月 19 日
編集済み: Matt J 2019 年 6 月 19 日
I have 14 tables that I want to combine into one large table. They each have different number of rows, but have the same number of columns (9). The number of rows vary from ~10,000 to ~200,000. I thought it would be easy to combine them by essentially stacking them on top of each other, however I'm struggling to find the right command. I want the combined table to have 9 columns, and the sum of all the rows of the smaller tables.

回答 (2 件)

Alex Herron
Alex Herron 2019 年 6 月 19 日
just found out that vertcat exists! nevermind!

Matt J
Matt J 2019 年 6 月 19 日
編集済み: Matt J 2019 年 6 月 19 日
I thought it would be easy to combine them by essentially stacking them on top of each other
It is that easy,
A=array2table(rand(3,2));
B=array2table(rand(5,2));
C=[A;B]
>> C=[A;B]
C =
8×2 table
Var1 Var2
_______ _______
0.81472 0.91338
0.90579 0.63236
0.12699 0.09754
0.2785 0.97059
0.54688 0.95717
0.95751 0.48538
0.96489 0.80028
0.15761 0.14189

カテゴリ

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