function [ val ] = slopefield(x,y)
if y>=0
    val=y*(y-2);
elseif y<0
    val=.5*y^2*cos(x)-y;
end

end

