title: What is the inverse of find() function in matlab
body: <p>In Matlab I can find all non zero entries in a vector like this:</p>
  
  <pre><code>&gt;&gt; v = [0 1 0 0 1]
  
  v =
  
       0     1     0     0     1
  
  &gt;&gt; indices = find(v)
  
  indices =
  
       2     5
  </code></pre>
  
  <p>Assuming that my vector <code>v</code> can only have <code>0</code> and <code>1</code> values, what is a simple way to reproduce <code>v</code> from the <code>indices</code> vector?</p>