title: Dummy variables to index - inverse of dummyvar function?
body: <p>I have a matrix of dummy variables, where each row is all 0 except for a single 1 indicating which class that sample is a member of.  For example <code>[1 0 0; 0 0 1]</code> indicates that the first sample is from class 1 and the second from class 3. I want a function that returns <code>[1; 3]</code>. </p>
  
  <p>The function <code>dummyvar</code> is the inverse of what I want. Is there an elegant solution that doesn't require a for loop?</p>