title: Create a loop that changes the number on a vector's name - Matlab
body: <p>I am trying to create a while-loop on MatLab that will alter the numerical bit of a vector's name. 
  To be precise, I have created an initial column vector named p1=[0.7;0.3]; also, I have generated a matrix named A = [0.8 0.1;0.2 0.9].
  What I want to achieve is create a while-loop with n from 1 to 7 where at each state I will multiply the matrix A with vector p(n). 
  For example:</p>
  
  <pre><code>A = [ 0.8 0.1; 0.2 0.9 ];
  p1 = [0.7; 0.3];
  n=1;
  while n&lt;=7
      q=A*p(n);
      n=n+1;
      p(n)=q;
  end
  </code></pre>
  
  <p>At the end I would like to be able to see vector p7.</p>
  
  <p>Any suggestions?
  Thank you very much.</p>