title: Converting a "boolean" string to an array in MATLAB
body: <p>I need to convert a string of boolean indices into an array which would look like this:</p>
  
  <pre><code>convert('11001') = [1 2 5]
  convert('0000') = []
  convert('001') = [3]
  </code></pre>
  
  <p>I don't control the function which produces the string.</p>
  
  <p>Any ideas to do this in an elegant way? I already did it whith a loop but it looks wrong somehow.</p>