nx = 101;
ny = 51;
its = 20;
[x, y] = meshgrid(linspace(-2, 1, nx), linspace(-1, 1, ny));
c = x + y*1i;
z = zeros(ny, nx);
w = char(ones(ny, nx)*' ');
shade = ".:!*oe&#%@";
its_s = floor(its/(length(shade)));
for i = 1:(its/its_s)
    for j = 1:its_s
        z = z.*z + c;
    end
    for j = 1:(nx*ny)
        if z(j) < 1
            w(j) = shade(i);
        end
    end
end
w