comparison toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/mk_ps_from_clqs.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 function mk_ps_from_clqs(dbn, T, cliques, dir)
2
3 % Draw multiple copies of the DBN,
4 % and indicate the nodes in each clique by shading the nodes.
5 % Generate a series of color postscript files,
6 % or, if dir=[], displays them to the screen and pauses.
7
8 if isempty(dir)
9 print_to_file = 0;
10 else
11 print_to_file = 1;
12 end
13
14 if print_to_file, cd(dir), end
15 flip = 1;
16 clf;
17 [dummyx, dummyy, h] = draw_dbn(dbn.intra, dbn.inter, flip, T, -1);
18
19 C = length(cliques);
20
21 % nodes = [];
22 % for i=1:C
23 % cl = cliques{i};
24 % nodes = [nodes cl(:)'];
25 % end
26 %nodes = unique(nodes);
27 ss = length(dbn.intra);
28 nodes = 1:(ss*T);
29
30 for c=1:C
31 for i=cliques{c}
32 set(h(i,2), 'facecolor', 'r');
33 end
34 rest = mysetdiff(nodes, cliques{c});
35 for i=rest
36 set(h(i,2), 'facecolor', 'w');
37 end
38 if print_to_file
39 print(gcf, '-depsc', sprintf('clq%d.ps', c))
40 else
41 disp(['clique ' num2str(c) ' = ' num2str(cliques{c}) '; hit key for next'])
42 pause
43 end
44 end