title: Comparing columns of matrix and giving boolean output
body: <p>I have checked other questions. I didn't find my answer. I have a matrix of n * 2 size. I want to compare the 1st and 2nd column and based on which is greater I want to assign 0/1 to the respective index. Suppose  I want an output as </p>
  
  <pre><code>a = 1 2
      4 3
      7 8
  </code></pre>
  
  <p>I want the output like this</p>
  
  <pre><code>out = 0 1
        1 0
        0 1
  </code></pre>
  
  <p>I did this :   </p>
  
  <pre><code>o1 = a(:,1) &gt; a (:,2)
  o2 = not(o1)
  out = [o1, o2] 
  </code></pre>
  
  <p>This does the job but I am sure there's a better way to do this. Need suggestions on that/.
  Forgot to mention, the datatype is float in the matrix.</p>