Find the number of 1s in sections of a logical array

20 ビュー (過去 30 日間)
Adam Fitchett
Adam Fitchett 2019 年 10 月 25 日
コメント済み: Adam Fitchett 2019 年 10 月 25 日
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?

採用された回答

the cyclist
the cyclist 2019 年 10 月 25 日
編集済み: the cyclist 2019 年 10 月 25 日
sum(reshape(A,288,[]))'
where A is your original array.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

タグ

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by