innerjoin of table of tables
1 view (last 30 days)
Show older comments
In MATLAB 2017b I cannot do an innerjoin of two tables where one or both has a table for the datatype associated with one of the variables. This was fixed in ML 2018 along with some better display support for tables of tables ... but stepping up a version of ML is not an easy option for me. Does anyone have a workaround to get innerjoin to work in 2017b?
Here is some code that runs in 2018a but not 2017b
a = cellfun(@(x)table(x,'variablenames',{'b'}),num2cell(1:10),...
'uniformoutput',false);
b = table((1:10)',cat(1,a{:}),'variablenames',{'b','a'});
d.c = (101:2:110)';
d.b = (1:2:10)';
e=struct2table(d);
f=innerjoin(b,e,'keys','b')
0 Comments
Answers (1)
Samatha Aleti
on 29 Jan 2020
a = cellfun(@(x)table(x,'variablenames',{'b'}),num2cell(1:10),...
'uniformoutput',false);
conv = zeros(1,10);
for i = 1:10
conv(i) = table2array(a{i});
end
b = table((1:10)',cat(1,conv'),'variablenames',{'b','a'});
d.c = (101:2:110)';
d.b = (1:2:10)';
e=struct2table(d);
f=innerjoin(b,e,'keys','b');
0 Comments
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!