combining cell arrarys to one cell
Show older comments
I have a cell array containing a number (say n) of 1x4 cells. I want to combine them in one cell to obtain a cell of nx4 cells. please let me know the solution.
Thanks all.
Accepted Answer
More Answers (1)
Here's a demo using fake data.
t = {{1:4}',{1:4}',{1:4}'}; %also works if t is columnar
m = cell2mat([t{:}]')
m =
1 2 3 4
1 2 3 4
1 2 3 4
2 Comments
carl hooper
on 27 Sep 2018
Edited: carl hooper
on 27 Sep 2018
Adam Danz
on 27 Sep 2018
That's identical to my 2nd line. The first line in my response is just producing fake data. Glad it worked!
Categories
Find more on Logical 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!