How to find the mean in a 3d matrix?

2 ビュー (過去 30 日間)
Junayed Chowdhury
Junayed Chowdhury 2018 年 1 月 26 日
回答済み: Walter Roberson 2018 年 1 月 26 日
Hi all, I am trying to find the mean of a set of instances in a 3d matrix. I have a 3d matrix of 190x381x297, i was trying to work with a loop that creates another 3d matrix from the first one calculating the mean of each 3 sets of 190x381, among 297 instances. that means final outcome should be a 190x381x99 matrix..
can anyone help?

回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 1 月 26 日
Y = YourArray;
result = permute( mean( reshape(Y, size(Y,1), size(Y,2), 3, size(Y,3)/3), 3), [1 2 4 3]);

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by