Azzera filtri
Azzera filtri

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

8 visualizzazioni (ultimi 30 giorni)
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!

Risposta accettata

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

Più risposte (1)

Walter Roberson
Walter Roberson il 25 Giu 2015
Modificato: Walter Roberson il 25 Giu 2015
b = cellfun(@squeeze, a, 'uniform', 0);
  3 Commenti

Accedi per commentare.

Categorie

Scopri di più su Structures in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by