How to sum over each n-th element in an array ?
2 次查看(过去 30 天)
显示 更早的评论
I have a 1 x 108108 array (named output) and I am trying to calculate the sum of elements in this fashion : a1 = sum (1st element + 1002th element + 2003th element +....+ (108108-1001)th element), for each 1008th element after the beginning one. The next sum would be a2 = sum (2nd element + 1003th element + 2004th element....+(108108-1001)th element) and so on till, a1001 = sum (1001th element + 2002th element + 3003th element +....108108th element). Afterwards, I want to collect a1,a2,a3...,a1001 into an array.
Could somebody point me to some documentation that will help me to do this ?
Thanks
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!