n = 1280; % optimal n from problem 5
xs = 2*(1:n)/n;
ys = initmatrix(n)\diverforces(70, n);
ys2 = initmatrix(n)\diverforces(100,n);
ys3 = initmatrix(n)\diverforces(130,n);

format long
plot(xs, ys,'b');
axis([0 2 -1 0.5]);
title('Problem 6: Deflection, 70kg Diver Standing on Edge');
xlabel('x (meters)');
ylabel('y (meters)');
disp('Deflection at x=2m: ');
disp(ys(n));

figure
plot(xs,ys,'b',xs,ys2,'g',xs,ys3,'r');
axis([0 2 -0.5 0.5]);
title('Problem 6: Deflection, 70, 100, 130 kg Diver Standing on Edge');
xlabel('x (meters)');
ylabel('y (meters)');