connect graphviz with matlab

http://blog.sina.com.cn/s/blog_661159d50100lqv0.html,有图像不显示的,请查看我的sina博客

 

Reference

1, http://www.stanford.edu/class/msande337/notes/matlab tutorial.pdf

2, http://newsgroups.derkeiler.com/Archive/Comp/comp.soft-sys.matlab/2009-10/msg06187.html

3, http://www.stanford.edu/~dgleich/demos/matlab/random_graphs/erdosreyni.html

It has made mention of Graphviz when I read paper about Bayesian networks. I have no idea about this. It takes me a long time to learn it. And now I make a list for my installing Graphviz with MATLAB.

Please download these packages to your computer refer to [1], like GraphViz program, MATLAB to AT&T GraphViz program and MESHPART toolbox. [1] gives the hyperlinks  to these packages. Then start by installing GraphViz on our computer.

If these all be done, we should add the target directory to MATLAB path, give my examples:

cd D:/SIAT/bayes/GraphViz2Mat1.2

pwd

addpath(genpath(fullfile(pwd, 'GraphViz2Mat1.2')));

savepath % save GraphViz2Mat1.2’s target directory to MATLAB path.

cd D:/SIAT/bayes/meshpartdist/meshpart

pwd

addpath(genpath(fullfile(pwd, 'meshpart')));

savepath % save MESHPART’s target directory to MATLAB path.

You have also not ready to start this, before you modify those files, refer to [2]

First, in dot_to_graph.m change (from line 92)

[node_pos] = sscanf(line(pos_pos:length(line)), ' pos = "%d,%d"')';

x(lst_node) = node_pos(1);

y(lst_node) = node_pos(2);

into

[node_pos] =sscanf(line(pos_pos:length(line)), ' pos = "%f,%f"',2)';

x(lst_node) = round(node_pos(1));

y(lst_node) = round(node_pos(2));

Second, in function draw_dot.m change line 43

labels = names(lbl_ndx);

into

labels = cellstr(num2str(num_names(lbl_ndx)'));

At last you can run the examples in [3]

 

Best wishes, good luck!

PS, give some pictures on my computer

connect <wbr>graphviz <wbr>with <wbr>matlab

connect <wbr>graphviz <wbr>with <wbr>matlab

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值