one! \n'</span>);

<span class="comment">% generates 1000 points in  [-1,1]</span>
u2 = linspace(-1.1,1.1,1000);

<span class="comment">% evaluate the interpolating polynomial using Horner's method</span>
vpol = x(1)*ones(1,1000);
vpoll1 = x1(1)*ones(1,1000);
<span class="keyword">for</span> i = 2:n
  vpol = vpol.*u2 + x(i);
  vpoll1 = vpoll1.*u2 + x1(i);
<span class="keyword">end</span>;

figure
<span class="comment">% plot function and interpolating polynomial</span>
plot(u2, vpol,<span class="string">'-'