Mercurial > hg > camir-aes2014
comparison toolboxes/FullBNT-1.0.7/KPMtools/softeye.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function M = softeye(K, p) | |
2 % SOFTEYE Make a stochastic matrix with p on the diagonal, and the remaining mass distributed uniformly | |
3 % M = softeye(K, p) | |
4 % | |
5 % M is a K x K matrix. | |
6 | |
7 M = p*eye(K); | |
8 q = 1-p; | |
9 for i=1:K | |
10 M(i, [1:i-1 i+1:K]) = q/(K-1); | |
11 end |