
function [hmm] = newhmm(ns,no,eps);

p0 = condprob(1,ns,eps);
Pt = condprob(ns,ns,eps);
Po = condprob(ns,no,eps);

hmm = struct('p0',p0,'Pt',Pt,'Po',Po);

% ------------------------------

function [P] = mkcond(P)

P = diag( 1 ./sum(P,2) )*P;

% ------------------------------

function [P] = condprob(n,m,eps);

P = ones(n,m) + eps*rand(n,m);
P = diag( 1 ./sum(P,2) )*P;






