function out=plot_residuals(xs,y_data,y_model,n)

plot(xs,y_data,'b*')
hold on 
plot(xs,y_model,'gd')

for i=1:n
    plot([xs(i),xs(i)],[y_data(i),y_model(i)],'-r')
end

out=1;

figure();

[diffs,rs,~,~]=compute_residuals(y_data,y_model,n);

plot(xs,rs,'rs')

figure();
plot(xs,diffs,'rs')
hold on
plot([0,n],[0,0],'-r')

