%!demo
%! ## `innerjoin` keeps only rows whose key exists in *both* tables — unmatched
%! ## rows are dropped — and, unlike `join`, the right key need not be unique.
%! ## Pass `'Keys'` to match on several variables at once; here a row must agree on
%! ## both `Name` and `Year` to match.
%!
%! L = table ({'Li'; 'Li'; 'Diaz'}, [2023; 2024; 2023], [10; 11; 12], ...
%!            'VariableNames', {'Name', 'Year', 'Visits'})
%! R = table ({'Li'; 'Diaz'}, [2023; 2023], categorical ({'NY'; 'CA'}), ...
%!            'VariableNames', {'Name', 'Year', 'State'})
%! innerjoin (L, R, 'Keys', {'Name', 'Year'})
%!
%! ## Li's 2024 row has no match on the right, so it is excluded.  Extra outputs
%! ## give the source row indices in the left and right tables.
%! [T, iL, iR] = innerjoin (L, R, 'Keys', {'Name', 'Year'});
%! [iL, iR]
