How do I concatenate 2 cell arrays?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Cai Chin
le 27 Déc 2020
Réponse apportée : Walter Roberson
le 27 Déc 2020
Hi, I am attempting to concatenate 2 cell arrays such that the dimensions of the concatenated cell array are 2215 x 1, with each cell containing a 2 x 900 double. Each of the component cell arrays ahs dimensions of 2215 x 1 with each cell containing a 1 x 900 double. Any suggestions would be greatly appreciated, thanks in advance.
0 commentaires
Réponse acceptée
Walter Roberson
le 27 Déc 2020
FirstCell = num2cell(randi(9, 15, 9), 2);
SecondCell = num2cell(randi(9, 15, 9), 2);
size(FirstCell)
size(FirstCell{1})
output = cellfun(@(a,b) [a;b], FirstCell, SecondCell, 'uniform', 0);
size(output)
size(output{1})
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!