Mean matrix of different size matrices in one cell array

1 view (last 30 days)
Hi, everybody!
I have different size 3D matrices in 1x5 cell array, like this :
A = {{9×119×11},{6×119×11},{8×119×11},{9×119×11},{7×119×11}}
How to find one mean matrix across all matrices?
Thanks so much in advance for your help!
  3 Comments
IM
IM on 13 Sep 2019
Expected output must be only one 3D matrix ,like this : X×119×11.
Stephen23
Stephen23 on 13 Sep 2019
"Expected output must be only one 3D matrix ,like this : X×119×11"
And what is X for your given example?

Sign in to comment.

Accepted Answer

Stephen23
Stephen23 on 13 Sep 2019
Edited: Stephen23 on 13 Sep 2019
C = cellfun(@(m)mean(m,1),A, 'uni',0);
B = cat(1,C{:})

More Answers (1)

Matt J
Matt J on 13 Sep 2019
Edited: Matt J on 13 Sep 2019
cellfun( @(a)mean(a(:)) , A)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!