HMM forward algorithm in MATLAB Does anyone know where can I find a pseudo code or MATLAB code of the HMM forward algorithm? 
 A: I quick google search gives you many interesting results. For example:
From mathworks:
http://www.mathworks.co.uk/help/stats/hidden-markov-models-hmm.html
http://www.mathworks.co.uk/matlabcentral/fileexchange/23089-forward-algorithm-hmm/content/pr_hmm.m 
A: I wanted to augment Googleit's answer to this link http://www.mathworks.co.uk/matlabcentral/fileexchange/23089-forward-algorithm-hmm/content/pr_hmm.m
I liked this given how simple it is, but the code comments are lacking. I normally barely care about code comments but I wanted to sort of combine some of the math I saw in lecture with the code I saw on the screen. Here is the reproduced code with comments as follows
1.1. Initialization $\alpha_{1}(i)=\pi(i)b(O_{1}), 1\le i\le N $
n=length(a(1,:));
T=length(o);

for i=1:n
    m(1,i)=b(i,o(1))*pi(i);
end

1.2 Induction $\alpha_{t+1}(j)=\left(\sum_{i=1}^{N}\alpha_{t}(i)*a_{ij}\right)b_{j}\left(O_{t+1}\right)$ $1\le j\le N;\ 1\le t\le T-1;$
The vector is updated for each observation using this code
for t=1:(T-1)
    for j=1:n
        z=0;
        for i=1:n
            z=z+a(i,j)*m(t,i);
        end
        m(t+1,j)=z*b(j,o(t+1));
    end
end

1.3 Termination $P(O|\lambda)=\sum_{i=1}^{N}\alpha_{T}\left(i\right)$
We sum up the alpha vector to get the probability
p=0;
for i=1:n         %termination
    p=p+m(T,i);        
end

