Ezcontour在Matlab中缺少轮廓

时间:2012-08-25 16:52:29

标签: matlab plot mixture-model

我使用gmdistribution将数据拟合到高斯混合模型。我想绘制轮廓图http://imgur.com/yVE1M,其中轮廓明显缺失。对于一维问题,我发现fplot,但现在我很难过。

enter image description here

1 个答案:

答案 0 :(得分:2)

当我为高斯混合编写EM算法时,我遇到了类似的问题。以下是在我的案例中修复它的代码片段:

for l=1:k
        zz=gmdistribution(MU(l,:),SIG(:,:,l),PI(l));
        ezcontour(@(x,y)pdf(zz,[x y]),[minx1 maxx1],[miny1 maxy1],250);
end

关键是增加N

ezcontour(...,N) plots FUN over the default domain using an N-by-N
grid. The default value for N is 60.