Combining Cells into a single cell
427 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
How can I combine multiple cells in to a single cell
there are 6 cells, each m x n format (n is 17 in all)
I want a new cell created that just adds up below
so for example Cell1 is 50x17 Cell2 is 30x17 Cell3 is 20x17
new cell should then be : AllCell is 100x17
I thought of:
Allcell=cell(Cell1+Cell2+Cell3,17);
but what then
4 commentaires
Réponse acceptée
Plus de réponses (1)
Jan
le 9 Jan 2013
If your cells are not called "Cell1", "Cell2", ... but you use an index as index (as suggested repeatedly and consequently in this forum), the concatenation is even easier:
C{1} = rand(50, 17);
C{2} = rand(10, 17);
C{3} = rand(40, 17);
C{4} = rand(30, 17);
C{5} = rand(20, 17);
AllC = {cat(1, C{:})};
5 commentaires
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!