D=diag([1 1 10^(-2)]);
b=[1 1 0]';
x=[1.05 0.95 10]';
W=x;
r=b-D*x;
p=r;
for j=1:5,
   a=p'*r/(p'*D*p);
   x=x+a*p;
   W=[W x];
   r=b-D*x;
   c=-p'*D*r/(p'*D*p);
   p=r+c*p;
end
kk=W(1,:);ll=W(2,:);mm=W(3,:);

% Plots
subplot(2,2,1), plot3(kk,ll,mm,'--',kk,ll,mm,'or'),...
   set(gca,'box','on'),...
   xlabel('x'), ylabel('y'),zlabel('z'),...
   grid, title('3D View')
subplot(2,2,2), plot(kk,ll,'--',kk,ll,'or'),...
   xlabel('x'), ylabel('y'),grid, title('X-Y Plane')
subplot(2,2,3), plot(kk,mm,'--',kk,mm,'or'),...
   xlabel('x'), ylabel('z'),grid, title('X-Z Plane')
subplot(2,2,4), plot(ll,mm,'--',ll,mm,'or'),...
   xlabel('y'), ylabel('z'),grid, title('Y-Z Plane')
