Compute the mean row cell elements in a cell array.

Hello,
I have a 3x11 cell array. Each cell contains a 128 x 1000 element.
I would like to compute the mean of the all the rows but leaving the columns alone, so that the results will be a 1 x 11 cell array with each element = 128x1000. Please help. Thanks
Eric

 採用された回答

Stephen23
Stephen23 2021 年 12 月 9 日

1 投票

Where C is your cell array:
fun = @(varargin)mean(cat(3,varargin{:}),3);
D = cellfun(fun,C(1,:),C(2,:),C(3,:),'uni',0)

1 件のコメント

ET
ET 2021 年 12 月 9 日
Many thanks, Mr. Stephen

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

ET
2021 年 12 月 9 日

コメント済み:

ET
2021 年 12 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by