Join two tables with the same headers

105 ビュー (過去 30 日間)
Trevor Savage
Trevor Savage 2016 年 4 月 19 日
コメント済み: Colin Fulham 2019 年 5 月 20 日
I have two tables created from different sources that have the same headers that I would like to join together. Table one has 10 rows with Headers: A B C D
Table two has 11 rows with Headers: A B C D
I would like to make a combined table with all columns and 21 rows
What do I have to tell MatLab to make it do what I want it to do?
  1 件のコメント
Trevor Savage
Trevor Savage 2016 年 4 月 19 日
Thanks!

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

採用された回答

Guillaume
Guillaume 2016 年 4 月 19 日
編集済み: Guillaume 2016 年 4 月 19 日
just vertically concatenate them:
newtable = [table1; table2]; %note the semicolon for vertical concatenation
%or
newtable = vertcat(table1, table2);
  2 件のコメント
Caglar
Caglar 2018 年 10 月 31 日
Hello, How would you do it if you were not sure headers were aligned? (for example, first table headers: A B C D, second table headers: B C A D)
Colin Fulham
Colin Fulham 2019 年 5 月 20 日
As long as the Variable names in both tables are the same, Matlab will reorder the second table to match the first before it concatenates them.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by