make a mandelbrot set

10 views (last 30 days)
yazid berrached
yazid berrached on 30 Jan 2015
Edited: yazid berrached on 30 Jan 2015
hi, i want to draw the mandelbrot set without the instruction (z=z.^2+c) because i will manipulate the X's and Y's there is my code :
if true
precision = 0.01;
Nmax = 500;
X=-2.5:precision:1.5;
Y=-1.5:precision:1.5;
[x,y]=meshgrid(X,Y);
xZ=x;
yZ=y;
c=x+i*y;
test=0.;
xC=real(c);
yC=imag(c);
for n=1:Nmax;
xZ=xZ.^2-yZ.^2+x;
yZ=2.*xZ.*yZ+y;
z=xZ+i*yZ;
test=test+(abs(yZ.^2+xZ.^2)<=4);
n;
end;
mesh(X,Y,log(test+10));
colormap(hot.^0.6);
axis([-2.5 1.5 -1.5 1.5]);
axis off;
end
but i have something wrong i don't know what it is ?
please help

Answers (0)

Categories

Find more on Fractals in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!