ion Markov network</h1><!--introduction--><p>Koller and Friedman ex 4.4.14</p><!--/introduction--><pre class="codeinput"><span class="comment">% This file is from pmtk3.googlecode.com</span>

edges = {[1 2], [1 3], [2 4], [3 4]};
ndx  = 1;
F = zeros(0, 2^4);
<span class="keyword">for</span> e=1:length(edges)
  s = edges{e}(1); t = edges{e}(2);
  <span class="keyword">for</span> j=1:2
    <span class="keyword">for</span> k=1:2
      <span class="keyword">if</span> j==2 &amp;&amp; k==2, <span class="keyword">