
npts=2000;
niter=1000;
Re=repmat(linspace(-1.5,0.5,npts),npts,1);
Im=repmat(linspace(-1,1,npts)',1,npts);
t=Re;
u=Im;


for j=1:niter
    q=Re.*Re-Im.*Im+t;
    h=2.*Re.*Im+u;
    qltfive= q < 5.;
    Re = q.*qltfive + 5..* not(qltfive);
    qgtmfive=q>-5.;
    Re = Re.*(qgtmfive) - 5. .*not(qgtmfive);
    hltfive=h<5;
    Im = h.*(hltfive) + 5..*not(hltfive);
    hgtmfive=h>-5;
    Im = Im.*(hgtmfive) - 5..*not(hgtmfive);
end

%ima=log( sqrt(Re.*Re+Im.*Im) + 1);
%imagesc(ima);
%colormap("hsv");

exit





