make a mandelbrot set

10 vues (au cours des 30 derniers jours)
yazid berrached
yazid berrached le 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

Réponses (0)

Catégories

En savoir plus sur Fractals dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by