xlist = []
ylist = []

i = sqrt(-1);

N = 100;

for x=-2:0.02:2

    for y=-2:0.02:2

        c = x + y*i;
        z = 0;
        for n=1:N
            z = z*z + c;
            if abs(z) > 2
               break
            end
        end

        if n == N
           xlist = [xlist x];
           ylist = [ylist y];
        end

    end

end

plot(xlist, ylist, 'o')
