A fast way of reshaping a cell array with elements with different sizes

8 次查看(过去 30 天)
Hello all,
I have a cell array in this form:
a=[1x16x16 double] [1x8x16 double] [1x4x16 double] [1x2x16 double]
I am looking for a fast way to reshape each element such that I get
a=[16x16 double] [8x16 double] [4x16 double] [2x16 double].
I would appreciate your help!

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2015-6-25
cellfun(@(x) reshape(x,[],16),your_cell,'un',0)

更多回答(1 个)

Walter Roberson
Walter Roberson 2015-6-25
编辑:Walter Roberson 2015-6-25
b = cellfun(@squeeze, a, 'uniform', 0);
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by