How to create mean matrix in multi-dimensional array

Hello,
I have multi-dimensional array that is 8x8x40. This is basically a 8x8 correlation matrix that is concatenated across 40 people. I would like to get the mean 8x8 correlation matrix for the first 20 and then the mean correlation matrix for the last 20. If I do mean(A,3) it gives me the mean for all 40 people but I would like the individual means for two groups. Would I have to divide the array into two (one for each group)? If so how would I do this?
Thanks.

 採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 3 月 26 日

0 投票

a=rand(8,8,40) %example
a1=a(:,:,1:20);
a2=a(:,:,21:end)
m1=mean(a1,3)
m2=mean(a2,3)

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by