lvcunjing 发表于 2005-12-3 13:26

求koch曲线的metlab源程序,谢谢!

求koch曲线的metlab源程序,以及Mandelbrot和Logistic方程的metlab源程序,请高手指点,不胜感激!

happy 发表于 2005-12-3 16:21

回复:(lvcunjing)求koch曲线的metlab源程序,谢谢!...

<P>递归法生成Koch曲线<BR><BR>function =Koch(z,A,n); <BR>% 递归法生成Koch曲线 <BR>% Example: <BR>%   =Koch(0,pi/2,0); <BR>% 算法见: <BR>% http://graphics.shu.edu.cn/course/fractal/program/p3-4-1-2.htm <BR><BR>N=4;   % 递归次数 <BR>len=400/3^n; <BR>hold on; <BR><BR>if n&gt;=N <BR>   plot(/i); <BR>   z=z+len*exp(i*A); <BR>else <BR>   =Koch(z,A,n+1); <BR>   A=A+pi/3; <BR>   =Koch(z,A,n+1); <BR>   A=A-pi*2/3; <BR>   =Koch(z,A,n+1); <BR>   A=A+pi/3; <BR>   =Koch(z,A,n+1); <BR>end <BR>axis on;axis equal <BR>% zz=xlim; <BR>% xlim()</P>

happy 发表于 2005-12-3 16:23

回复:(lvcunjing)求koch曲线的metlab源程序,谢谢!...

<FONT face=新宋体>XL=-2.1;XR=0.8;YD=-1.3;YU=1.3;<BR>x=linspace(XL,XR,800);<BR>y=linspace(YD,YU,800);<BR>=meshgrid(x,y);<BR>C=complex(X,Y);<BR>Z=zeros(800,800);<BR>clr=Z;<BR>for N = 1:85,<BR> Z=Z.^2+C;<BR> clr=clr+(256-3*N)*(clr==0).*(abs(Z)&gt;200);<BR>end<BR>colormap(jet(256));<BR>image(clr);<BR>axis off image;<BR>print -dpng Mandelbrot.png;</FONT><PRE> </PRE>

happy 发表于 2005-12-3 16:29

回复:(lvcunjing)求koch曲线的metlab源程序,谢谢!...

Logistic模型看帖子<BR><BR><BR><a href="http://vib.hit.edu.cn/vibbbs/dispbbs.asp?BoardID=35&amp;replyID=19671&amp;id=4738&amp;skin=0" target="_blank" >http://vib.hit.edu.cn/vibbbs/dispbbs.asp?BoardID=35&amp;replyID=19671&amp;id=4738&amp;skin=0</A>
页: [1]
查看完整版本: 求koch曲线的metlab源程序,谢谢!