make a mandelbrot set

10 ビュー (過去 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 Center および File ExchangeFractals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by