innerjoin of table of tables
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Samatha Aleti
el 29 de En. de 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 comentarios
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!