Merging tables with partly the same column names, but sometimes different dimensions
24 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
James Johnson
il 21 Dic 2022
Modificato: Bora Eryilmaz
il 21 Dic 2022
Hi,
I have two tables with partly the same variable names. I want to merge these together and put them underneath each other, with all values of each variable under each other and empty cases for variables that are not present in the one table.
How can I do this?
Thank you!
0 Commenti
Risposta accettata
Bora Eryilmaz
il 21 Dic 2022
Modificato: Bora Eryilmaz
il 21 Dic 2022
This seems like a table (outer) join problem. Take a look at: https://www.mathworks.com/help/matlab/ref/table.outerjoin.html
Tleft = table({'a' 'b' 'c'}', [1 2 3]', 'VariableNames', {'Key1' 'Var1'})
Tright = table({'a','b','d'}', [4 5 6]', 'VariableNames', {'Key1' 'Var2'})
T = outerjoin(Tleft, Tright, 'MergeKeys', true)
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Whos in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!