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

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!

 Akzeptierte Antwort

Weitere Antworten (1)

Walter Roberson
Walter Roberson am 25 Jun. 2015
Bearbeitet: Walter Roberson am 25 Jun. 2015
b = cellfun(@squeeze, a, 'uniform', 0);

3 Kommentare

Thank you, but I am getting the following error: Error using cellfun Non-scalar in Uniform output, at index 1, output 1. Set 'UniformOutput' to false.
I really appreciate it!

Melden Sie sich an, um zu kommentieren.

Kategorien

Gefragt:

Mnr
am 25 Jun. 2015

Kommentiert:

Mnr
am 26 Jun. 2015

Community Treasure Hunt

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

Start Hunting!

Translated by