function B=MarkovMatrix(n) % function B=MarkovMatrix(n); will return an n x n matrix with probability % vectors as columns. B=randn(n,n); B=exp(B); %Exponentiate to get all positive entries. Cols=sum(B); B=B./repmat(Cols,n,1); %Divide so that the col sums to one