You need to convert strings in foo.var1 to characters, assuming the 1st column name in foo and bar are both 'var1'.
Run:
foo.var1_converted = cellfun(@(x) char(x),foo.var1,'UniformOutput',false);
then you will get a new column 'var1_converted' in foo, which contains the converted characters from strings in column 'var1'.
Then run:
new_tab = join(foo,bar,'leftkeys','var1_converted','rightkeys','var1');
you will get your joined table.
1 Comment
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/381636-join-tables-based-on-string-in-one-cell-in-the-other#comment_533519
Direct link to this comment
https://la.mathworks.com/matlabcentral/answers/381636-join-tables-based-on-string-in-one-cell-in-the-other#comment_533519
Sign in to comment.