MATLAB Answers

Pankaj
0

Converting cell to 3 dimensional matrix

Asked by Pankaj
on 25 Feb 2017
Latest activity Edited by Stephen Cobeldick on 25 Feb 2017
I have a cell of size [1, 50] each of it is 11 x 2 matrix.
I would like it to convert it to a 3-d matrix of size 11 X 2 X 50.
How it can be done? Cane it be done using reshape?
Thanks

  0 Comments

Sign in to comment.

1 Answer

Answer by Stephen Cobeldick on 25 Feb 2017
Edited by Stephen Cobeldick on 25 Feb 2017
 Accepted Answer

If C is your cell array:
cell2mat(permute(C,[1,3,2]))
or
cell2mat(reshape(C,1,1,[]))
or
cat(3,C{:})

  0 Comments

Sign in to comment.