Joining 2 tables to make 1 table
3 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have 2 tables. I want to join these tables together to make 1 table.
They have the same number of columns.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254444/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/254445/image.png)
What code should I use to joint them?
Thank you.
2 件のコメント
採用された回答
Jesus Sanchez
2019 年 12 月 14 日
You can unite them as if they were matrixes:
complete_table = [table1 ; table2]; % This should work to join the columns of both tables
0 件のコメント
その他の回答 (1 件)
Guillaume
2019 年 12 月 14 日
Sounds like you merely want to vertically concatenate your two tables. The only problem is that they don't have the same variable names, so you'll have to rename the variables of one of them:
table_old.Properties.VariableNames = table_new.Properties.VariableNames; %rename variables in old table. Could do it the other way round
merged = [table_old; table_new]
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Tables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!