How can I put two tables into one?
4 views (last 30 days)
Show older comments
Hey,
This seems like a simple thing but I couldn't do it yet. How can I join two tables with the same column names? Example: Join the two first tables to become like the third one.

0 Comments
Accepted Answer
Star Strider
on 27 Feb 2017
You can vertically concatenate them just as you would any other array:
Apple = [1 2 3]';
Banana = [4 5 6]';
T1 = table(Apple, Banana)
Apple = [9 8 7]';
Banana = [8 9 10]';
T2 = table(Apple, Banana)
T12 = [T1; T2]
Apple Banana
_____ ______
1 4
2 5
3 6
T2 =
Apple Banana
_____ ______
9 8
8 9
7 10
T12 =
Apple Banana
_____ ______
1 4
2 5
3 6
9 8
8 9
7 10
0 Comments
More Answers (0)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!