fractal
代码说明:
matlab程序画图,常见分形图,function cantor(A,B) c=1 p=0 figure hold on plot([A(2) B(2)],[A(1) B(1)], r* ) while norm(A(1,:)-B(1,:))>=1 C=[] D=[] for i=1:size(A,1) a=A(i,:)+(B(i,:)-A(i,:))/3 b=A(i,:)+2*(B(i,:)-A(i,:))/3 C=[C A(i,:) b] D=[D a B(i,:)] end A=C B=D p=p+1 (matlab program drawing, common fractal images function cantor(A,B) c=1 p=0 figure hold on plot([A(2) B(2)],[A(1) B(1)], r* ) while norm(A(1,:)-B(1,:))>=1 C=[] D=[] for i=1:size(A,1) a=A(i,:)+(B(i,:)-A(i,:))/3 b=A(i,:)+2*(B(i,:)-A(i,:))/3 C=[C A(i,:) b] D=[D a B(i,:)] end A=C B=D p=p+1 )
下载说明:请别用迅雷下载,失败请重下,重下不扣分!