title: Function programming from a ranking to binary choice matrix
body: <p>I have some difficulties programming a function in MATLAB. I want to construct a function that converts a given ranking into a binary choice matrix. For example, when 3 options are ranked in a ranking R(3,1,2) the binary choice matrix should be </p>
  
  <pre><code>[0 1 0;
   0 0 0; 
   1 1 0]
  </code></pre>
  
  <p>So when element <code>i</code> proceeds element <code>j</code>, the matrix element <code>a(i,j)</code> is <code>1</code> and <code>0</code> otherwise. Could anyone help me create this function please?</p>