t">% least squares soln</span>

v = -1:.1:3;
<span class="comment">%v = -5:.5:5;</span>
nv = length(v);
[w0,w1] = meshgrid(v);
w0=w0(:)';
w1=w1(:)';
m = length(w0);

SS = sum(((ones(n,1)*w0 + x*w1) - repmat(y,1,m)).^2,1);
SS = reshape(SS,nv,nv);

<span class="keyword">if</span> 0
figure;
surf(v,v,SS)
printPmtkFigure(<span class="string">'linregSurfSSE'</span>)
<span class="keyword">end</span>

<span class="keyword">if</span> doPlot
figure
contour(v,v,SS)
hold <span class="string">on</span>
plot(w(1),w(2),<s