merging two tables gives me an error

2 views (last 30 days)
Hi, I am trying to merge two tables but i get the following error. why is that? the first table consists of 6 columns and 100000 rows and the second one consists of 6 columns and 2000000 rows. thanks
join(x20062008,x20082010) Error using table/join (line 111) The key variable for B must have unique values.

Accepted Answer

Image Analyst
Image Analyst on 23 Oct 2014
Try using semicolon. Try this:
t1 = table(['M';'F';'M'],[45;32;34],...
{'NY';'CA';'MA'},logical([1;0;0]),...
'VariableNames',{'Gender' 'Age' 'State' 'Vote'})
t2 = table(['M';'F';'M'],[49;54;14],...
{'AZ';'AK';'OH'},logical([1;0;0]),...
'VariableNames',{'Gender' 'Age' 'State' 'Vote'})
tJoined = [t1;t2]

More Answers (0)

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!