I have a vector, x, and am trying to count the number of one values at each position every 3 rows.
x = [1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 ]'
In this case it should be 5 for the first row.
x = [1 0 0 1 0 0 0 1 0 1 0 0 0 1 0]'
In this case it should be 3 for the first row and 2 for the second row.
How can it get these answers out of it?
Best Answer