フィルターのクリア

Mean of some elements in a matrix

2 ビュー (過去 30 日間)
A Basu
A Basu 2017 年 8 月 13 日
コメント済み: A Basu 2017 年 8 月 14 日
I have a matrix A of dimension 25 x 51. I want to calculate the mean of every sequential 5 elements of each row and store them in another matrix. Precisely I want to compute mean(A(1:5,1)), mean(A(6:10,1)) and so on for all columns and save it in another matrix Q of dimension 5 x 51.
Can anyone help me out with the loop??

採用された回答

Matt J
Matt J 2017 年 8 月 13 日
編集済み: Matt J 2017 年 8 月 13 日
Using SEPBLOCKFUN ( Download ),
result=sepblockfun(yourMatrix,[5,1],'mean');
  1 件のコメント
A Basu
A Basu 2017 年 8 月 14 日
Thanks!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by