function y = heaviside(x)
y = (x > 0) + 0.5*(x == 0);