title: While loop Vectorization
body: <p>I would like to know if there is some way to vectorize this code. I tried so hard to do it... but failed.</p>
  
  <pre><code>while (delta_F &gt; e) &amp;&amp; (i &lt; maxLoop)      
      x1 = x0+d;
      y0 = f(x0);
      y1 = f(x1);
      if y1 &lt; y0
          x0= x1;
          d = a*d;
      else
          vF = [vF;x1];
          d = -b*d;
      end
      i = i + 1;
      if length(vF) &gt; 1
          ultm = vF(end);
          pultm = vF(end-1);
          delta_F = abs(ultm+pultm)/2;
      end
  end
  </code></pre>
  
  <p>It's a simple implementation of the Rosenbrock method for finding the min of a function.</p>