If I understood correctly:
Ax = randi([0 1], 4, 960);
[row, col] = find(A);
blockidx = discretize(col, 1:60:size(A, 2));
Bx = accumarray([row, blockidx], col, [], @(c) {sort(c).'})
Note: I'm not working on the whole cell array here, just one of these 4x960 matrix as I've not understood what that had to do with the question. Possibly, you just want to above in a loop (or cellfun) operating over each element of the cell array.
Best Answer