title: Convert vector to a specific matrix in Matlab
body: <p>For given vector with values from <code>y0</code> to <code>yT</code> I have to create following matrix:</p>
  
  <pre><code>1  y(P-1)  y(P-2) ... y(0)
  1  y(P)    y(P-1) ... y(1)
  1  y(P+1)  y(P)   ... y(2)
  .   .       .     ...  .
  .   .       .     ...  .
  .   .       .     ...  .
  1  y(T-1)  y(T-2) ... y(T-p)
  </code></pre>
  
  <p>P means y(P) is a linear combination of P previous y's.</p>
  
  <p>P is given (for example 100). </p>
  
  <p>Is there any matlab function for this?</p>
  
  <p>function to get the right <code>y</code> for given <code>i,j</code> is </p>
  
  <pre><code>getAIJ = @(i, j) y(p+(-(i+1))+(j-1));
  </code></pre>
  
  <p>So I just need to apply this function for every cell in matrix except the first column. Is there any <em>matlab-way</em> to do this? I am not sure how to use arrayfun on this.</p>