title: Matlab - Flip 1's to 0's in a matrix
body: <p>I have a very large sparse matrix (each row is several thousand elements--most of the elements are 0's). In addition, I have a vector of row indexes, and I need to perform the following operation on each row:</p>
  
  <p>Flip half the non-zero elements (randomly chosen from all non-zero elements in the row) to zero, and save the column indexes of the flipped elements.</p>
  
  <p>Thanks for any pointers.</p>