concatenate tables based on table row names
Afficher commentaires plus anciens
How can I concatenate the following tables:
a = table([5; 76; 25; 321; 523; 21; 562; 74], 'RowNames', {'a','b','c','d','e','f','g','h'});
b = table([487; 96; 325; 98; 741; 23], 'RowNames', {'a','b','d','e','g', 'h'});
c = table([25; 325; 32; 52; 21], 'RowNames', {'a','d','e','f','g'});
...
z = table([2; 35; 2; 52; 1; 63; 45], 'RowNames', {'a','c','d','e','f','g','h'});
To obtain
Table = 8 by z
a b c ... z
a 5 487 25 ... 2
b 76 96 0 ... 0
c 25 0 0 ... 35
d 321 325 325 ... 2
e 523 98 32 ... 52
f 21 0 52 ... 1
g 562 741 21 ... 63
h 74 23 0 ... 45
2 commentaires
Sai Gudlur
le 13 Juin 2020
Hello,
Same as putting together a table with vectors or matrices.
T = [a b c] % combine them along column dimension.
T1 = [a;b;c] % combine them along row dimension.
Ronald
le 13 Juin 2020
Réponses (1)
Sai Gudlur
le 13 Juin 2020
0 votes
You could also try "vertcat" on tables.
5 commentaires
Ronald
le 13 Juin 2020
Ronald
le 13 Juin 2020
madhan ravi
le 13 Juin 2020
Modifié(e) : madhan ravi
le 13 Juin 2020
outerjoin(...) is the way to go. Ronald post it as an answer so others could benifit from it.
Sai Gudlur
le 14 Juin 2020
Thank you Ronald, for outerjoin wasn't aware of this option.
Ronald
le 14 Juin 2020
Catégories
En savoir plus sur Digital Filter Design dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!