class="string">'seed'</span>,1);
rand(<span class="string">'seed'</span>,1);

m=40;  n=2;    A = randn(m,n);
xex = [5;1];
pts = -10+20*rand(m,1);
A = [ones(m,1) pts];
b = A*xex + .5*randn(m,1);
outliers = [-9.5; 9];  outvals = [20; -15];
A = [A; ones(length(outliers),1), outliers];
b = [b; outvals];
m = size(A,1);
pts = [pts;outliers];

<span class="comment">% Least Squares</span>
fprintf(1,<span class="string">'Computing the solution of the least-squares problem...'</span>);

xls =  A\b;

fprintf(1,<span c