title: How to convert a binary row vector to a normal row vector in Matlab?
body: <p>I have a binary row vector e.g.</p>
  
  <blockquote>
    <p>b = dec2bin(15)</p>
  </blockquote>
  
  <p>This vector behaves badly when I try to multiply it component-wise with a 'normal' vector. How do I convert b to a normal vector?</p>
  
  <p>To be more specific, if</p>
  
  <blockquote>
    <p>d = [1 2 3 4]</p>
  </blockquote>
  
  <p>I want</p>
  
  <blockquote>
    <p>n = d.*b</p>
  </blockquote>
  
  <p>to give me [1 2 3 4], but it instead gives [49    98   147   196].</p>
  
  <p>Thanks</p>