how to reshape cell array

59 次查看(过去 30 天)
I have a 1x4620 cell array and every element is a 7x7x4 3D matrix. What should I do if I want convert this cell 1x4620 to 77x60 cell array.
  2 个评论
jgg
jgg 2016-1-19
Why does this:
c = cell(4620,1)
d = reshape(c,[77,60])
Not work?
Meggie Hwang
Meggie Hwang 2016-1-19
thank you. It's work! I just tried reshape(c,{77,60}) and it's failure. ha ha......

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2016-1-19
Use reshape
newCa = reshape(ca, 77, 60);
The contents of the cell don't matter - they don't enter into it at all. See the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
  2 个评论
Image Analyst
Image Analyst 2016-1-19
P.S. A cell array take up an enormous amount of overhead memory as compared to a double array. You should consider just using a 4D array of doubles instead of a cell array.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by