フィルターのクリア

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

8 ビュー (過去 30 日間)
Mnr
Mnr 2015 年 6 月 25 日
コメント済み: Mnr 2015 年 6 月 26 日
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 件のコメント
Walter Roberson
Walter Roberson 2015 年 6 月 25 日
Code corrected.
Mnr
Mnr 2015 年 6 月 26 日
I really appreciate it!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by