%% Append Values from One Table to Another
% Create a table, Tleft.

Tleft = table({'Janice','Jonas','Javier','Jerry','Julie'}',[1;2;1;2;1],...
        'VariableNames',{'Employee' 'Department'})

%
% Create a table, Tright, with a variable in common with Tleft.

Tright = table([1 2]',{'Mary' 'Mona'}',...
         'VariableNames',{'Department' 'Manager'})

%
% Create a new table, T, containing data from tables Tleft and Tright. Use the join function to repeat and append Manager data from table Tright to the data from table Tleft, based on the key variable, Department.

T = join(Tleft,Tright)

% Copyright 2012 The MathWorks, Inc.