Average the 3rd dimension in a matrix

3 ビュー (過去 30 日間)
Jonas Damsbo
Jonas Damsbo 2019 年 1 月 4 日
コメント済み: Jonas Damsbo 2019 年 1 月 4 日
I have a 360x181x360.
I want to average the 3rd dimension with 4, so I get a new matrix like 360x181x90.
How can I do that?

採用された回答

Bruno Luong
Bruno Luong 2019 年 1 月 4 日
編集済み: Bruno Luong 2019 年 1 月 4 日
Mean every 4 indices of the third dimension
A=rand(360,181,360);
[m,n,p] = size(A);
m = mean(permute(reshape(A,m,n,4,[]),[1 2 4 3]),4)
  1 件のコメント
Jonas Damsbo
Jonas Damsbo 2019 年 1 月 4 日
Thanks! It's working!

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

その他の回答 (0 件)

カテゴリ

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