[x y] = meshgrid(-2:0.1:2, -2:0.1:2); z = 1 ./ (1 + exp(-x.^2 + y)); surf(x, y, z);