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??

 Réponse acceptée

Matt J
Matt J le 13 Août 2017
Modifié(e) : Matt J le 13 Août 2017
Using SEPBLOCKFUN ( Download ),
result=sepblockfun(yourMatrix,[5,1],'mean');

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Centre d'aide et File Exchange

Question posée :

le 13 Août 2017

Commenté :

le 14 Août 2017

Community Treasure Hunt

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

Start Hunting!

Translated by