function [W]=mandel(a,b,c,d,K)
m=200;
x=linspace(a,b,m);
y=linspace(c,d,m);

z=zeros(m);
for h=1:m
    for k=1:m
        s = x(h)+i*y(k);
        z(h,k) = s;
        for iter=1:K;
            z(h,k)=z(h,k)^2+s;
if (abs(z(h,k))>1.e16)
  break
endif
         endfor
     endfor
endfor
W=exp(-abs(z));
imagesc(x,y,W')
endfunction
