% Hsol3 --- Get optimal value of lambda, and compute xlambda
lambda = fzero('rootfcn',[0 13]);
fprintf('The optimal lambda = %g\n',lambda)
coef = vv./(lambda+s2);
xlambda = p(:,1:r)*coef;
exl = xlambda'*xlambda;
fprintf('The energy of xlambda = %g\n',exl)
ylambda = A*xlambda;
plot(v,yvec,v,ylambda)
pause
plot(v,xlambda)
