Replace nonzero sparse matrix elements with ones
R = spones(S)
R = spones(S) generates
R with the same sparsity structure as
1's in the nonzero positions.
c = sum(spones(S)) is the number of nonzeros
in each column.
r = sum(spones(S'))' is the number of nonzeros
in each row.
equal, and are equal to