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 次查看(过去 30 天)
显示 更早的评论
here some of my efforts from different codes I found ... no results
0 个评论
采纳的回答
更多回答(1 个)
Andrei Bobrov
2017-11-4
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);
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!