conversion of cell 30X1 in 30X24

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.

Answers (1)

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

Categories

Tags

Asked:

on 28 Sep 2015

Answered:

on 28 Sep 2015

Community Treasure Hunt

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

Start Hunting!