MATLAB: Copy the content of one table to an other table with different size

table

I need to copy the "GroupCount" of the first table to the second table. Second table has larger size and I need to copy the GrouCount of table one to the second table with correpsonding tme and radius. For example GroupCount=1 of the first row of the first table should be copied to the seond table that its time=0 and its radous is 0.
I used this code but I got error:
table2.x=...
table1.GroupCount(table1.time==table2.time && table1.radius==table2.radius)
and the error:
Matrix dimensions must agree.

Best Answer

This is trivially done with outerjoin:
mergedtable = outerjoin(yourbigtable, yourgroupcounttable, 'Keys', {'Time', 'radius'}, 'MergeKeys', true, 'Type', 'left')
Any time you want to merge tables, look at join, innerjoin, or outerjoin depending on the type of join you need.