Help with matrix manipulation in matlab

1 回表示 (過去 30 日間)
aurc89
aurc89 2014 年 9 月 9 日
コメント済み: aurc89 2014 年 9 月 9 日
I have a matrix M with dimension 600x500. I want to do an average of its values along vertical direction, in order to have a matrix with smaller dimension. For example, I want to obtain a matrix with dimension 200x500: this means that, every three values along each column, I take just one (which is the average of the three values). How can I do this ? Thanks!

採用された回答

Andrei Bobrov
Andrei Bobrov 2014 年 9 月 9 日
編集済み: Andrei Bobrov 2014 年 9 月 9 日
out = squeeze(mean(reshape(M,3,[],size(M,2))));
  1 件のコメント
aurc89
aurc89 2014 年 9 月 9 日
Thanks!

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

その他の回答 (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