title: Creating Indicator Matrix
body: <p>For a vector <strong>V</strong> of size <strong>n x 1</strong>, I would like to create binary indicator matrix <strong>M</strong> of the size <strong>n x Max(V)</strong> such that the row entries of <strong>M</strong> have <strong>1</strong> in the corresponding columns index, <strong>0</strong> otherwise.</p>
  
  <p>For eg: If <strong>V</strong> is </p>
  
  <pre><code>V = [ 3
        2
        1
        4]
  </code></pre>
  
  <p>The indicator matrix should be</p>
  
  <pre><code>M= [ 0 0 1 0
       0 1 0 0
       1 0 0 0
       0 0 0 1]
  </code></pre>