demo_laplace_2d
clear
clf
#随机产生数据
n1=80; n2=40;#负例80 正例40
S1 = eye(2); S2 = [1 0.95; 0.95 1];#协方差矩阵
m1 = [0.75; 0]; m2 = [-0.75; 0];#期望
randn('seed',17);#生成随机数种子
x1 = chol(S1)'*randn(2,n1)+repmat(m1,1,n1);#将矩阵m1复制1*n1块,即由1*n1块m1平铺而成
x2 = chol(S2)'*randn(2,n2)+repmat(m2,1,n2);
x = [x1 x2]';
y = [repmat(-1,1,n1) repmat(1,1,n2)]';
pause