annotate toolboxes/FullBNT-1.0.7/bnt/examples/dynamic/mk_ps_from_clqs.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 function mk_ps_from_clqs(dbn, T, cliques, dir)
Daniel@0 2
Daniel@0 3 % Draw multiple copies of the DBN,
Daniel@0 4 % and indicate the nodes in each clique by shading the nodes.
Daniel@0 5 % Generate a series of color postscript files,
Daniel@0 6 % or, if dir=[], displays them to the screen and pauses.
Daniel@0 7
Daniel@0 8 if isempty(dir)
Daniel@0 9 print_to_file = 0;
Daniel@0 10 else
Daniel@0 11 print_to_file = 1;
Daniel@0 12 end
Daniel@0 13
Daniel@0 14 if print_to_file, cd(dir), end
Daniel@0 15 flip = 1;
Daniel@0 16 clf;
Daniel@0 17 [dummyx, dummyy, h] = draw_dbn(dbn.intra, dbn.inter, flip, T, -1);
Daniel@0 18
Daniel@0 19 C = length(cliques);
Daniel@0 20
Daniel@0 21 % nodes = [];
Daniel@0 22 % for i=1:C
Daniel@0 23 % cl = cliques{i};
Daniel@0 24 % nodes = [nodes cl(:)'];
Daniel@0 25 % end
Daniel@0 26 %nodes = unique(nodes);
Daniel@0 27 ss = length(dbn.intra);
Daniel@0 28 nodes = 1:(ss*T);
Daniel@0 29
Daniel@0 30 for c=1:C
Daniel@0 31 for i=cliques{c}
Daniel@0 32 set(h(i,2), 'facecolor', 'r');
Daniel@0 33 end
Daniel@0 34 rest = mysetdiff(nodes, cliques{c});
Daniel@0 35 for i=rest
Daniel@0 36 set(h(i,2), 'facecolor', 'w');
Daniel@0 37 end
Daniel@0 38 if print_to_file
Daniel@0 39 print(gcf, '-depsc', sprintf('clq%d.ps', c))
Daniel@0 40 else
Daniel@0 41 disp(['clique ' num2str(c) ' = ' num2str(cliques{c}) '; hit key for next'])
Daniel@0 42 pause
Daniel@0 43 end
Daniel@0 44 end