comment">% Given data u_1,...,u_m and v_1,...,v_m in R, the goal is to fit to the</span>
<span class="comment">% data a polynomial of the form</span>
<span class="comment">% p(u) = x_1 + x_2*u + ... + x_n*u^{n-1}</span>
<span class="comment">% i.e. solve the problem:  minimize ||Ax - v||</span>
<span class="comment">% where A is the Vandermonde matrix s.t. Aij = u_i^{j-1}</span>
<span class="comment">% Two cases are considered: L2-norm and Linfty-norm</span>

<span class="comment">% Input data</span>
n=6;
m