function SSD_plot(vp,u,y)

y0 = input('y0: ');

% .00005 (four zeros)
step = input('y0 step size: ');  

% 6
n = input('Number of steps (forward and backward): ');  

loc = input('Measurement location: ');
x = input('x-coordinate of measurement (mm): ');

y0lower = y0 - step*n;
y0upper = y0 + step*n;
y0vec = linspace(y0lower, y0upper, 2*n + 1);

ustar = u/vp;
L = length(y);

uprime = zeros(1,L);            % matrix to store computed u'
squareDiff = zeros(1,L);        % vector to store [(u*-u')^2]i
errs = zeros(1,(2*n + 1));

for j = 1:(2*n + 1)
    for i = 1:L
        uprime(1,i) = 1 - exp(-y(i)/y0vec(j));
    end
    for i = 1:L
        squareDiff(1,i) = (ustar(i) - uprime(1,i))^2;
    end
	jDiff = sum(squareDiff(1,:));
    errs(1,j) = jDiff;
end

plot(y0vec, errs, 'o')
xlabel('y0')
ylabel('Sum of squared differences')
title(['y0 error distribution for x = ',num2str(x), ' mm (location ', num2str(loc), ')'])