I have a cell called Object that contains 1x24 cells which all have 1 column but have the number of rows ranging from 14 to 16. Some cells, however, are empty. I would like to concatenate these cell into one single cell P with the dimension of 16 x 24. This is what I have tried:
for z=1:24
Summary.P{z}=cat(2,Object{1,z});
end
However, this gives me the error: Cell contents assignment to non-cell array object. Is this because I have the empty cells? Ideally, I'd like to get rid of the empty cells before concatenating.
Could anyone please help me?
Thanks!
P.S. If the different numbers of rows are an issue, I could just use the first 14 rows of each cell. This will make all the non-empty cells even in terms of the number of rows.