title: Removing zeros and concatenating vectors
body: <p>I have an array </p>
  
  <pre><code>x =
  
      404  1  1  5  5  1  1  5  0  0   0   0   0   0   0   0  0
      405  2  5  5  4  5  2  5  4  5   3   3   2   5   3   3  0
      406  5  5  3  5  3  5  4  3  3   1   4   0   0   0   0  0
  </code></pre>
  
  <p>I'd like to remove all the <strong>zeros</strong> EXCEPT the ones directly to the right of a non-zero integer. i.e. all but the last zero in a row of integers. (e.g., <code>x=x(x~0);</code> just removes zeros but then returns a column vector. So that's not quite right) Then concatenate all the the remaining vectors.</p>
  
  <p>Like this:</p>
  
  <pre><code>404  1  1  5  5  1  1  5  0 405  2  5  5  4  5  2  5  4  5   3   3   2   5   3   3  0 406  5  5  3  5  3  5  4  3  3   0   4
  </code></pre>
  
  <p>Any ideas?</p>