make a mandelbrot set

조회 수: 8 (최근 30일)
yazid berrached
yazid berrached 2015년 1월 30일
편집: yazid berrached 2015년 1월 30일
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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Fractals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by