Hello all,
I have a cell of dimensions 1×36, for which 23 of the 36 elements in the cell have dimensions 22 x 91000. The remaining elements in the cell have dimensions 22 x 85000. I am trying to convert this 1×36 cell into a 3D matrix of dimensions 22 x 31000 x 36, where upon the number 31000 corresponds to the last 31000 elements of the 91000 (or 85000) elements of any particular coloumn for any particular cell element.
I tried using the code:
3D_Matrix = cell2mat(My_Cell_Array)
however, I got an error because you cannot concatenate coloumns of unequal length together to create a matrix. I then tried using a for loop structured like this:
for P = 1:22 for K = (Don't know how to code this???) for J = 1:36 3D_Matrix (:,:,J) = cell2mat(My_Cell_Array(P,K,J)); end endend
However, I do not know how to tell matlabe to only take the last 31000 elements of each coloumn of each cell when creating the 3D matrix using the for loops. Could anyone give me an idea on how to properly code this?
Thanks in advanced.
Best Answer