clear
fx='x^2-y^2+a';
fy='2*x*y+b';
axis([-2 0.5 -1.2 1.2]);
axis square
hold on
set(gca,'Fontsize',12)
xlabel('\it a','Fontsize',12)
ylabel('\it b','Fontsize',12)
title('A simple sketch of the Mandelbrot set','Fontsize',12)
%disp('Pause is in effect; enalarge the figure window and press any key')
%pause
for a=-2:0.01:.5
for b=-1.2:0.01:1.2
x=0;
y=0;
for k=1:25
f1(k)=eval(fx);
f2(k)=eval(fy);
x=f1(k);
y=f2(k);
end
if sqrt(x^2+y^2)<2
plot(a,b,'erasemode','none');
drawnow;
end
end %end for b
end %end for a