I have an excel file which contains 4076 rows and 13 columns. I want the average of every 42 rows of every single column and then store them in a new spreadsheet.Can you help me with the code?I'm a beginner using Matlab and I don't know much.
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sofia Fourkioti
le 4 Nov 2017
Commenté : Sofia Fourkioti
le 5 Nov 2017
here some of my efforts from different codes I found ... no results
0 commentaires
Réponse acceptée
Image Analyst
le 4 Nov 2017
What about conv2()?
B = conv2(A, ones(42, 1)/42, 'valid');
2 commentaires
Plus de réponses (1)
Andrei Bobrov
le 4 Nov 2017
B = rand(4076,13);
a = 42;
i0 = ceil((1:size(B,1))'/a);
[ii,jj] = ndgrid(i0,1:size(B,2));
out = accumarray([ii(:),jj(:)],B(:),[],@mean);
Voir également
Catégories
En savoir plus sur Spreadsheets dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!