title: Inference in Dynamic Bayesian Network using Bayes Net Toolbox for Matlab
body: <p>I am working on a project on Automatic chord recognition which uses a 2-TBN dynamic bayesian network in which there are 4 discrete hidden nodes and 2 continuous observable nodes. </p>
  
  <p>I created the model using the bayes net toolbox and there is no problem regarding that. 
  The fifth and sixth nodes are observable nodes of 13 and 12 dimensions each.
  I am trying to use the inference part of the toolbox which I am unable to do. I wrote the following code which is not giving the correct output.</p>
  
  <pre><code>function [path,data] = mydecode(bnet,mean,sigma,dat)
  
  dataaa=dat';
  data=dataaa(1:12,:);
  %chord dimension
  chord=109;
  %observed chroma dimension
  obs=12;
  evidence = cell(6,T);
  for i=1:T
     evidence(6,i)={dat(i,1:12)} ;
  end 
  for i=1:T
     evidence(5,i)={dat(i,13:25)} ;
  end
  
  engine = {};
  engine{end+1} = smoother_engine(jtree_2TBN_inf_engine(bnet));
  disp(engine);
  
  mpe = find_mpe(engine{1}, evidence);
  
  end
  </code></pre>
  
  <p>Please tell me how to proceed with the inference.</p>