function val = cossim(x,y)

if size(x)~=size(y)
    error('x and y must be the same size');
end

if size(x,2)~=1
    error('x and y must be vectors');
end

val = 1 - (x'*y)/(sqrt((x'*x)*(y'*y))+0.005);

end

