%script file to plot filled julia sets of cubics %create real and imaginary value arrays [X,Y]=meshgrid([-2:0.01:2]); [m,n]=size(X); maxiters=30; T=maxiters*ones(m,n); %set the parameters a=-1.5+0*i; b=0+0*i; %compute the cubic escape criteria escrit=[abs(b),sqrt(abs(a)+2)] escriter=max(escrit); for j=1:m fprintf ('on iterate %d\n',j); for k=1:n z=X(j,k)+i*Y(j,k); for t=1:maxiters y=z^3+a*z+b; z=y; if abs(z)>2 T(j,k)=t; break; end end end end imagesc(T); colorbar;