title: decoding array inputs and while loops
body: <p>I basically just need help decoding this code in matlab,  what does each line mean and what does it do?</p>
  
  <p>Basically, Create an array, g, where each value in g is the previous value of g, but squared. Stop when g reaches a value at or greater than 100 times the original value of g.</p>
  
  <pre><code>g = input('Please provide an initial value: '); 
  
  while ((g == 1) || (g == 0))    
             disp('Cannot be 0 or 1')    
             g = input('Please provide an initial value: ');
  end
  
  i = 1; 
  while ((g(i)^2)&lt;=(100*g(1)))    
          g(i+1) = g(i)^2;    
          i = i+1; 
  end
  
  g = g'
  </code></pre>
  
  <p>The code, asks for a number that cannot be 0 or 1.  The number is then squared but stops when the next value is less than or equal to 100 times the initial number.</p>
  
  <p>for example if you input 2
  the code will spit out 2, 4, 16, and will stop because the next value is 256, which is greater than 2 * 100 = 200.</p>
  
  <p>Thank you, in advance.</p>