conversion of cell 30X1 in 30X24
4 views (last 30 days)
Show older comments
Hi,everyone. I have a cell 30X1 and i want to convert it in a cell 30X24 to do mathematical operation line by line.I attached an image to help you undarstand what i want to do.
0 Comments
Answers (1)
Guillaume
on 28 Sep 2015
Assuming your cell array consists of 30 1x24 matrices, you could just concatenate them all vertically:
c = num2cell(repmat(1:24, 30, 1), 2); %demo cell array
m = vertcat(c{:})
I would leave it at that and work with a matrix from then one. Matrices are much easier to deal with than cell arrays.
If you do really want to have a 30x24 cell array, use num2cell to convert the matrix into a cell array:
newc = num2cell(vertcat(c{:}))
As said, there is little point in the final cell array
0 Comments
See Also
Categories
Find more on Data Type Conversion 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!