声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 5973|回复: 16

[分形与混沌] 我用逃逸时间算法画的Julia集的彩色分形图

[复制链接]
发表于 2007-8-21 16:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
详细请见孙博文的《分形算法与程序设计-Visual C++实现》。他是用Vc++实现的,我用Matlab实现的,但是我的图像和他得到的彩色不太一样,好像他的好些!
未命名.PNG

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2007-8-21 16:55 | 显示全部楼层
能不能贴出程序来分享一下
发表于 2007-8-21 18:56 | 显示全部楼层

回复 #1 liliangbiao 的帖子

看了一下你的两个帖子,基本上都是图片欣赏类的,建议发到图片版?
 楼主| 发表于 2007-8-22 10:18 | 显示全部楼层
不是欣赏啊!我这里是讨论啊!因为我说了孙博文先生画的要比我做的好些,我现在向大家请教如何在Matlab里面实现他那种色彩特别逼真的分形图,我在Matlab里面调试了好久,也没有实现,不知道大家能不能帮这个忙?
发表于 2007-8-22 10:30 | 显示全部楼层

回复 #4 liliangbiao 的帖子

那你把源程序发上来啊,一者大家可能没时间找书再自己编程序,二者毕竟研究方向都不相同,不可能有那么充足的时间专门研究一下这个,还请见谅
 楼主| 发表于 2007-8-22 14:23 | 显示全部楼层
请浏览我在研学论坛 混沌与分形上边的发表的帖子吧!
发表于 2007-8-22 14:36 | 显示全部楼层
:@) 不好意思,我很少进研学
而且这里大多数会员可能也没有注册过那里,发到这里共享不是很好吗?为什么一定要去那里?
 楼主| 发表于 2007-8-22 17:28 | 显示全部楼层
呵呵 无所谓了,这些天发帖子都累的很了,算了吧,要是真正的想学一样东西,就不怕累吧!
所以我觉得去研学没有什么错误的。互相学习一下!

[ 本帖最后由 mjhzhjg 于 2007-8-26 15:46 编辑 ]
发表于 2007-8-22 17:31 | 显示全部楼层

回复 #8 liliangbiao 的帖子

:@) 去研学当然没错误,只是我觉得你发到这里让大家更方便共享而已
大家来这里当然想学东西,可是也要为方便大家考虑不是吗
发表于 2007-8-22 19:04 | 显示全部楼层

回复 #8 liliangbiao 的帖子

到研学论坛看了 没有找到你的程序呀
 楼主| 发表于 2007-8-22 19:47 | 显示全部楼层
有的!
发表于 2007-8-24 10:25 | 显示全部楼层
我在研学论坛上找了一下 只找到liliangbiao这个Mandelbrot Set集的分形程序 自己没有试 大家看看
%这是画的Mandelbrot Set集的分形程序(彩色图像)!经过试验和调试是没有错误的!
Nmax = 50; scale = 0.005;
xmin = -2.4; xmax = 1.2;
ymin = -1.5; ymax = 1.5;
% Generate X and Y coordinates and Z complex values
[x,y]=meshgrid(xmin:scale:xmax, ymin:scale:ymax);
z = x+1i*y;
% Generate w accumulation matrix and k counting matrix
w = zeros(size(z));
k = zeros(size(z));
% Start off with the first step ...
N = 0;
% While N is less than Nmax and any k's are left as 0
while N<Nmax & ~all(k()
% Square w, add z
w = w.^2+z;
% Increment iteration count
N = N+1;
% Any k locations for which abs(w)>4 at this iteration and no
% previous iteration get assigned the value of N
k(~k & abs(w)>4) = N;
end
% If any k's are equal to 0 (i.e. the corresponding w's never blew up) set
% them to the final iteration number
k(k==0) = Nmax;
% Open a new figure
figure
% Display the matrix as a surface
s=pcolor(x,y,k);
% If you truly want the Mandelbrot curve in B&W, comment the above line and
% uncomment these two
% s = pcolor(x, y, mod(k, 2));
% colormap([0 0 0;1 1 1])
% Turn off the edges of the surface (because the cells are so small, the
% edges would drown out any useful information if we left them black)
set(s,'edgecolor','none')
% Adjust axis limits, ticks, and tick labels
axis([xmin xmax -ymax ymax])
fontsize=15;
set(gca,'xtick',[xmin:0.4:xmax],'FontSize',fontsize)
set(gca,'ytick',[-ymax:0.5:ymax],'FontSize',fontsize)
xlabel('Re z','FontSize',fontsize)
ylabel('Im z','FontSize',fontsize)

评分

1

查看全部评分

发表于 2007-8-24 14:30 | 显示全部楼层
这里有更简单的Mandelbrot Set集的分形程序:

x=linspace(-2,0.5,300);
y=linspace(-1.25,1.25,300);      
[X,Y]=meshgrid(x,y);
n_iter=200; c=0; a=2;           
W=mandelbrot(X,Y,c,a,n_iter);                     
pcolor(X,Y,W), shading flat;
axis('square'); colormap prism(256);


function W=mandelbrot(X,Y,c,a,n_iter)           
C=X+i*Y;
W=zeros(size(X));
Z=c;
for k=1:n_iter,
     Z=Z.^2+C;                                 
     i0=find(abs(Z)>a);
   W(i0)=k;
  Z(i0)=NaN;
end
i0=find(W==0); W(i0)=NaN;

评分

1

查看全部评分

发表于 2007-8-29 21:53 | 显示全部楼层

回复 #6 liliangbiao 的帖子

这么做好像不怎么厚道吧
发表于 2008-7-1 13:40 | 显示全部楼层

急啊,我的作业

有没有画julia集的程序啊?在matlab上实现
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-5-19 08:06 , Processed in 0.173525 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表