Matching the two columns of two different tables and to combine the common values in second table.
8 views (last 30 days)
Show older comments
I want to match two columns of different tables. One table has one column with a "station code" and other bale has 5 columns in which the first column has "station code". I want to print the final result with 5 column table with single and commmon station code.
Thank you.
0 Comments
Accepted Answer
Kevin Holly
on 18 Aug 2022
Edited: Kevin Holly
on 18 Aug 2022
3 Comments
Kevin Holly
on 18 Aug 2022
t=table;
t.Column1 = rand(10,1);
t.station = {'Code1';'Code2';'Code3';'Code4';'Code5';'Code6';'Code7';'Code8';'Code9';'Code10'}
t2=table;
t2.station = {'Code1';'Code3';'Code4';'Code6';'Code7'};
t2.Column2 = rand(5,1);
t2.Column3 = rand(5,1);
t2.Column4 = rand(5,1);
t2.Column5 = rand(5,1)
t4 = innerjoin(t,t2)
More Answers (0)
See Also
Categories
Find more on Tables 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!