Find the number of 1s in sections of a logical array
13 次查看(过去 30 天)
显示 更早的评论
I have a logical array (column vector) which has a length of 41,472. I need to find out how many ones there are in the first 288 rows of this array, in the second 288 rows, in the third 288 rows and so on until I have a column vector listing the number of ones in each successive 288 row-sized block of the logical array. How would I go about doing this?
0 个评论
采纳的回答
the cyclist
2019-10-25
编辑:the cyclist
2019-10-25
sum(reshape(A,288,[]))'
where A is your original array.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!