How do i combine multiple cells into one

12 views (last 30 days)
fadams18
fadams18 on 13 Jul 2021
Answered: fadams18 on 13 Jul 2021
I have 3 cells each containting three 20x60 matrices
cell_1 = { 20x60, 20x60 , 20x60 }
...
cell_3= { 20x60, 20x60 , 20x60 }
I would like to stack them on top of each other
cell_1
cell_2
cell_3
so that i obtain final_cell =3 x 3 cell

Answers (2)

Chunru
Chunru on 13 Jul 2021
c1 = {rand(2), rand(2)}
c1 = 1×2 cell array
{2×2 double} {2×2 double}
c2 = {rand(2), rand(2)}
c2 = 1×2 cell array
{2×2 double} {2×2 double}
c3 = {rand(2), rand(2)}
c3 = 1×2 cell array
{2×2 double} {2×2 double}
c =[c1; c2; c3]
c = 3×2 cell array
{2×2 double} {2×2 double} {2×2 double} {2×2 double} {2×2 double} {2×2 double}

fadams18
fadams18 on 13 Jul 2021
ok never mind figured it out
final_cell=[cel_1; cell_2; cell_3]

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!