title: Creating a Recursive Function that Generates Pascal's Triangle (Matlab)
body: <p>I've been trying to figure out how to recursively generate Pascal's triangle in a matrix using Matlab. 
  Here is an example of how it should look like:</p>
  
  <pre><code> &gt;&gt;PascalT(0)  
   ans =  
    1
  
   &gt;&gt;PascalT(1)  
   ans =  
    0 1 0  
    1 0 1
  
   &gt;&gt;PascalT(2)  
   ans =  
    0 0 1 0 0   
    0 1 0 1 0  
    1 0 2 0 1
  
   &gt;&gt;PascalT(3)  
   ans =  
    0 0 0 1 0 0 0  
    0 0 1 0 1 0 0   
    0 1 0 2 0 1 0  
    1 0 3 0 3 0 1
  </code></pre>
  
  <p>My code so far is pretty empty because I can't figure out how to do it:</p>
  
  <pre><code>function AA = PascalT(n)  
      if n == 0   
          AA = 0;  
      else  
          rec = PascalT(n-1);  
          AA = zeroes(n+1,2*n+1);  
  
      end  
  end
  </code></pre>