title: best way to get a vector from sparse matrix
body: <p>I have a <code>m x n</code> matrix where each row consists of zeros and same values for each row.</p>
  
  <p>an example would be:</p>
  
  <pre><code>M = [-0.6 1.8 -2.3 0 0 0; 0 0 0 3.4 -3.8 -4.3; -0.6 0 0 3.4 0 0]
  </code></pre>
  
  <p>In this example the first column consists of <code>0</code>s and <code>-0.6</code>, second <code>0</code> and <code>1.8</code>, third <code>-2.3</code> and so on.</p>
  
  <p>In such case I would like to reduce m to 1 (get a vector from a given matrix) so in this example a vector would be <code>[-0.6 1.8 -2.3 3.4 -3.8 -4.3]</code></p>
  
  <p>Does anyone know what is the best way to get a vector from such matrix?</p>
  
  <p>Thank you!</p>