title: Reverse one logical bit in Matlab
body: <p>Does it exist a better way to reverse an element of X?</p>
  
  <pre><code>&gt;&gt; X = dec2bin(10)
  X = 1010
  </code></pre>
  
  <p>I did this:</p>
  
  <pre><code>x(i) = num2str(1-str2num(x(i)))
  </code></pre>