Here is one way. I doubt it is the best.
% Original table with two variables
x = {'a','b','a','a','b'}.';
y = {'c','c','c','d','d'}.';
tbl = table(x,y)
% Convert to numeric array of unique values
tbl_01 = [findgroups(tbl.x)-1, findgroups(tbl.y)-1]
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!