% HW5 solution for Julia set plot, updated for no Nans, just Infs.
% Barnett 11/3/15
c = -0.470 + 0.587i;
x = -1.5:0.005:1.5;
%x = -.15:0.001:0;
[xx,yy] = meshgrid(x,x);
zz = xx+1i*yy;
N=500; tic;
for n=1:N
 zz = zz.^2 + c;          % no nans appear in modern Matlab versions
end
toc
imagesc(x,x,isinf(zz));
colormap(gray); axis equal;
xlabel('Re z'); ylabel('Im z'); title('Julia set');
