Taking the mean of cell elements

Hi all,
I have a 12x29 cell filled with 1x1500 doubles. I would like to take the mean of each row of the cell and am having some trouble doing so.
For example, I would like to create a resulting cell that is 12x1 where each row is a 1x1500 double that is the mean of the 29 original columns.
From what I've tried so far, I have "bad cell reference" errors and also have an error when trying to use the cellfun(@mean, C) function. Any help or suggestions is appreciated. Thank you!

 採用された回答

Walter Roberson
Walter Roberson 2015 年 7 月 8 日

0 投票

cell2mat() to create a multidimensional array. Take the mean along the appropriate dimension. mat2cell() back into the cell array you want.

1 件のコメント

R J
R J 2015 年 7 月 8 日
Thanks Walter!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCell Arrays についてさらに検索

質問済み:

R J
2015 年 7 月 8 日

コメント済み:

R J
2015 年 7 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by