Filter löschen
Filter löschen

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

18 Ansichten (letzte 30 Tage)
Adam Fitchett
Adam Fitchett am 25 Okt. 2019
Kommentiert: Adam Fitchett am 25 Okt. 2019
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?

Akzeptierte Antwort

the cyclist
the cyclist am 25 Okt. 2019
Bearbeitet: the cyclist am 25 Okt. 2019
sum(reshape(A,288,[]))'
where A is your original array.

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by